Class Rdf
- java.lang.Object
-
- org.eclipse.rdf4j.sparqlbuilder.rdf.Rdf
-
public class Rdf extends Object
A class with static methods to create basicSparqlBuilderRDF objects from either string values or RDF4J Model objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RdfBlankNode.AnonymousBlankNodebNode()create an empty anonymous blank nodestatic RdfBlankNode.LabeledBlankNodebNode(String label)creates a labeled blank nodestatic RdfBlankNode.PropertiesBlankNodebNode(IRI predicate, RdfObject... objects)creates a label-less blank node, identified by the supplied predicate-object listsstatic RdfBlankNode.PropertiesBlankNodebNode(RdfPredicate predicate, RdfObject... objects)creates a label-less blank node, identified by the supplied predicate-object listsstatic Iriiri(String iriString)Create a SparqlBuilder Iri instance from a String iristatic Iriiri(String namespace, String localName)Create a SparqlBuilder Iri instance from a namespace and local namestatic Iriiri(IRI iri)Create a SparqlBuilder Iri instance from anIRIstatic RdfLiteral.BooleanLiteralliteralOf(Boolean boolValue)create an RDF boolean literalstatic RdfLiteral.NumericLiteralliteralOf(Number numberValue)create an RDF numeric literalstatic RdfLiteral.StringLiteralliteralOf(String stringValue)create an RDF string literalstatic RdfLiteral.StringLiteralliteralOfLanguage(String stringValue, String language)create a literal with a language tagstatic RdfLiteral.StringLiteralliteralOfType(String stringValue, IRI dataType)create a literal with a datatypestatic RdfLiteral.StringLiteralliteralOfType(String stringValue, Iri dataType)create a literal with a datatypestatic RdfObjectobject(Value value)static RdfObject[]objects(Value... values)static RdfPredicateObjectListpredicateObjectList(IRI predicate, RdfObject... objects)Create aRdfPredicateObjectListstatic RdfPredicateObjectListpredicateObjectList(RdfPredicate predicate, RdfObject... objects)Create aRdfPredicateObjectListstatic RdfPredicateObjectListCollectionpredicateObjectListCollection(IRI predicate, RdfObject... objects)Create aRdfPredicateObjectListCollectionwith an initialRdfPredicateObjectListstatic RdfPredicateObjectListCollectionpredicateObjectListCollection(RdfPredicateObjectList... predicateObjectLists)Create aRdfPredicateObjectListCollectionwith the givenRdfPredicateObjectList(s)static RdfPredicateObjectListCollectionpredicateObjectListCollection(RdfPredicate predicate, RdfObject... objects)Create aRdfPredicateObjectListCollectionwith an initialRdfPredicateObjectListstatic RdfLiteral.BooleanLiteral[]toRdfLiteralArray(Boolean... literals)Convert an array ofBooleans to an array ofRdfLiteral.BooleanLiteralsstatic RdfLiteral.NumericLiteral[]toRdfLiteralArray(Number... literals)Convert an array ofNumbers to an array ofRdfLiteral.NumericLiteralsstatic RdfLiteral.StringLiteral[]toRdfLiteralArray(String... literals)Convert an array ofStrings to an array ofRdfLiteral.StringLiterals
-
-
-
Method Detail
-
iri
public static Iri iri(String iriString)
Create a SparqlBuilder Iri instance from a String iri- Parameters:
iriString- the String representing the iri- Returns:
- the
Iriinstance
-
iri
public static Iri iri(IRI iri)
Create a SparqlBuilder Iri instance from anIRI- Parameters:
iri- the IRI- Returns:
- the SparqlBuilder
Iriinstance
-
iri
public static Iri iri(String namespace, String localName)
Create a SparqlBuilder Iri instance from a namespace and local name- Parameters:
namespace- the namespace of the IrilocalName- the local name of the Iri- Returns:
- a
Iriinstance
-
bNode
public static RdfBlankNode.LabeledBlankNode bNode(String label)
creates a labeled blank node- Parameters:
label- the label of the blank node- Returns:
- a new
RdfBlankNode.LabeledBlankNodeinstance
-
bNode
public static RdfBlankNode.PropertiesBlankNode bNode(RdfPredicate predicate, RdfObject... objects)
creates a label-less blank node, identified by the supplied predicate-object lists- Parameters:
predicate- the predicate of the initial predicate-object list to populate this blank node withobjects- the objects of the initial predicate-object list to populate this blank node with- Returns:
- a new
RdfBlankNode.PropertiesBlankNodeinstance - See Also:
- Blank node syntax
-
bNode
public static RdfBlankNode.PropertiesBlankNode bNode(IRI predicate, RdfObject... objects)
creates a label-less blank node, identified by the supplied predicate-object lists- Parameters:
predicate- the predicate of the initial predicate-object list to populate this blank node withobjects- the objects of the initial predicate-object list to populate this blank node with- Returns:
- a new
RdfBlankNode.PropertiesBlankNodeinstance - See Also:
- Blank node syntax
-
bNode
public static RdfBlankNode.AnonymousBlankNode bNode()
create an empty anonymous blank node- Returns:
- an empty
RdfBlankNode.AnonymousBlankNodeinstance
-
literalOf
public static RdfLiteral.StringLiteral literalOf(String stringValue)
create an RDF string literal- Parameters:
stringValue- the String instance to create a literal from- Returns:
- a
RdfLiteral.StringLiteralinstance representing the given String
-
literalOfType
public static RdfLiteral.StringLiteral literalOfType(String stringValue, Iri dataType)
create a literal with a datatype- Parameters:
stringValue- the literal stringdataType- the datatype tag- Returns:
- a
RdfLiteral.StringLiteralinstance representing the given String and datatype
-
literalOfType
public static RdfLiteral.StringLiteral literalOfType(String stringValue, IRI dataType)
create a literal with a datatype- Parameters:
stringValue- the literal stringdataType- the datatype as aIRI- Returns:
- a
RdfLiteral.StringLiteralinstance representing the given String and datatype
-
literalOfLanguage
public static RdfLiteral.StringLiteral literalOfLanguage(String stringValue, String language)
create a literal with a language tag- Parameters:
stringValue- the literal stringlanguage- the language tag- Returns:
- a
RdfLiteral.StringLiteralinstance representing the given String and language
-
literalOf
public static RdfLiteral.NumericLiteral literalOf(Number numberValue)
create an RDF numeric literal- Parameters:
numberValue- the Number instance to create a literal from- Returns:
- a
RdfLiteral.NumericLiteralinstance representing the given Number
-
literalOf
public static RdfLiteral.BooleanLiteral literalOf(Boolean boolValue)
create an RDF boolean literal- Parameters:
boolValue- the boolean to create a literal from- Returns:
- a
RdfLiteral.BooleanLiteralinstance representing the given boolean
-
predicateObjectList
public static RdfPredicateObjectList predicateObjectList(RdfPredicate predicate, RdfObject... objects)
Create aRdfPredicateObjectList- Parameters:
predicate- theRdfPredicateof the predicate-object listobjects- theRdfObject(s) of the list- Returns:
- a new
RdfPredicateObjectList
-
predicateObjectList
public static RdfPredicateObjectList predicateObjectList(IRI predicate, RdfObject... objects)
Create aRdfPredicateObjectList- Parameters:
predicate- theRdfPredicateof the predicate-object listobjects- theRdfObject(s) of the list- Returns:
- a new
RdfPredicateObjectList
-
predicateObjectListCollection
public static RdfPredicateObjectListCollection predicateObjectListCollection(RdfPredicate predicate, RdfObject... objects)
Create aRdfPredicateObjectListCollectionwith an initialRdfPredicateObjectList- Parameters:
predicate- theRdfPredicateof the initialRdfPredicateObjectListobjects- theRdfObject(s) of the initialRdfPredicateObjectList- Returns:
- a new
RdfPredicateObjectListCollection
-
predicateObjectListCollection
public static RdfPredicateObjectListCollection predicateObjectListCollection(IRI predicate, RdfObject... objects)
Create aRdfPredicateObjectListCollectionwith an initialRdfPredicateObjectList- Parameters:
predicate- theRdfPredicateof the initialRdfPredicateObjectListobjects- theRdfObject(s) of the initialRdfPredicateObjectList- Returns:
- a new
RdfPredicateObjectListCollection
-
predicateObjectListCollection
public static RdfPredicateObjectListCollection predicateObjectListCollection(RdfPredicateObjectList... predicateObjectLists)
Create aRdfPredicateObjectListCollectionwith the givenRdfPredicateObjectList(s)- Parameters:
predicateObjectLists- theRdfPredicateObjectList(s) to add to the collection- Returns:
- a new
RdfPredicateObjectListCollection
-
toRdfLiteralArray
public static RdfLiteral.StringLiteral[] toRdfLiteralArray(String... literals)
Convert an array ofStrings to an array ofRdfLiteral.StringLiterals- Parameters:
literals- theStrings to convert- Returns:
- an array of the corresponding
RdfLiteral.StringLiterals
-
toRdfLiteralArray
public static RdfLiteral.BooleanLiteral[] toRdfLiteralArray(Boolean... literals)
Convert an array ofBooleans to an array ofRdfLiteral.BooleanLiterals- Parameters:
literals- theBooleans to convert- Returns:
- an array of the corresponding
RdfLiteral.BooleanLiterals
-
toRdfLiteralArray
public static RdfLiteral.NumericLiteral[] toRdfLiteralArray(Number... literals)
Convert an array ofNumbers to an array ofRdfLiteral.NumericLiterals- Parameters:
literals- theNumbers to convert- Returns:
- an array of the corresponding
RdfLiteral.NumericLiterals
-
-