Class Rdf
java.lang.Object
org.eclipse.rdf4j.sparqlbuilder.rdf.Rdf
A class with static methods to create basic
SparqlBuilder
RDF objects from either string values or RDF4J
Model objects.-
Method Summary
Modifier and TypeMethodDescriptionbNode()
create an empty anonymous blank nodecreates a labeled blank nodecreates a label-less blank node, identified by the supplied predicate-object listsbNode
(RdfPredicate predicate, RdfObject... objects) creates a label-less blank node, identified by the supplied predicate-object listsstatic Iri
Create a SparqlBuilder Iri instance from a String iristatic Iri
Create a SparqlBuilder Iri instance from a namespace and local namestatic Iri
Create a SparqlBuilder Iri instance from anIRI
static RdfLiteral.BooleanLiteral
create an RDF boolean literalstatic RdfLiteral.NumericLiteral
create an RDF numeric literalstatic RdfLiteral.StringLiteral
create an RDF string literalstatic RdfLiteral.StringLiteral
literalOfLanguage
(String stringValue, String language) create a literal with a language tagstatic RdfLiteral.StringLiteral
literalOfType
(String stringValue, IRI dataType) create a literal with a datatypestatic RdfLiteral.StringLiteral
literalOfType
(String stringValue, Iri dataType) create a literal with a datatypestatic RdfObject
static RdfObject[]
static RdfPredicateObjectList
predicateObjectList
(IRI predicate, RdfObject... objects) Create aRdfPredicateObjectList
static RdfPredicateObjectList
predicateObjectList
(RdfPredicate predicate, RdfObject... objects) Create aRdfPredicateObjectList
predicateObjectListCollection
(IRI predicate, RdfObject... objects) Create aRdfPredicateObjectListCollection
with an initialRdfPredicateObjectList
predicateObjectListCollection
(RdfPredicateObjectList... predicateObjectLists) Create aRdfPredicateObjectListCollection
with the givenRdfPredicateObjectList
(s)predicateObjectListCollection
(RdfPredicate predicate, RdfObject... objects) Create aRdfPredicateObjectListCollection
with an initialRdfPredicateObjectList
static RdfLiteral.BooleanLiteral[]
toRdfLiteralArray
(Boolean... literals) Convert an array ofBoolean
s to an array ofRdfLiteral.BooleanLiteral
sstatic RdfLiteral.NumericLiteral[]
toRdfLiteralArray
(Number... literals) Convert an array ofNumber
s to an array ofRdfLiteral.NumericLiteral
sstatic RdfLiteral.StringLiteral[]
toRdfLiteralArray
(String... literals) Convert an array ofString
s to an array ofRdfLiteral.StringLiteral
s
-
Method Details
-
iri
-
iri
-
iri
-
bNode
creates a labeled blank node- Parameters:
label
- the label of the blank node- Returns:
- a new
RdfBlankNode.LabeledBlankNode
instance
-
bNode
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.PropertiesBlankNode
instance - See Also:
-
bNode
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.PropertiesBlankNode
instance - See Also:
-
bNode
create an empty anonymous blank node- Returns:
- an empty
RdfBlankNode.AnonymousBlankNode
instance
-
literalOf
create an RDF string literal- Parameters:
stringValue
- the String instance to create a literal from- Returns:
- a
RdfLiteral.StringLiteral
instance representing the given String
-
literalOfType
create a literal with a datatype- Parameters:
stringValue
- the literal stringdataType
- the datatype tag- Returns:
- a
RdfLiteral.StringLiteral
instance representing the given String and datatype
-
literalOfType
create a literal with a datatype- Parameters:
stringValue
- the literal stringdataType
- the datatype as aIRI
- Returns:
- a
RdfLiteral.StringLiteral
instance representing the given String and datatype
-
literalOfLanguage
create a literal with a language tag- Parameters:
stringValue
- the literal stringlanguage
- the language tag- Returns:
- a
RdfLiteral.StringLiteral
instance representing the given String and language
-
literalOf
create an RDF numeric literal- Parameters:
numberValue
- the Number instance to create a literal from- Returns:
- a
RdfLiteral.NumericLiteral
instance representing the given Number
-
literalOf
create an RDF boolean literal- Parameters:
boolValue
- the boolean to create a literal from- Returns:
- a
RdfLiteral.BooleanLiteral
instance representing the given boolean
-
predicateObjectList
public static RdfPredicateObjectList predicateObjectList(RdfPredicate predicate, RdfObject... objects) Create aRdfPredicateObjectList
- Parameters:
predicate
- theRdfPredicate
of the predicate-object listobjects
- theRdfObject
(s) of the list- Returns:
- a new
RdfPredicateObjectList
-
predicateObjectList
Create aRdfPredicateObjectList
- Parameters:
predicate
- theRdfPredicate
of the predicate-object listobjects
- theRdfObject
(s) of the list- Returns:
- a new
RdfPredicateObjectList
-
predicateObjectListCollection
public static RdfPredicateObjectListCollection predicateObjectListCollection(RdfPredicate predicate, RdfObject... objects) Create aRdfPredicateObjectListCollection
with an initialRdfPredicateObjectList
- Parameters:
predicate
- theRdfPredicate
of the initialRdfPredicateObjectList
objects
- theRdfObject
(s) of the initialRdfPredicateObjectList
- Returns:
- a new
RdfPredicateObjectListCollection
-
predicateObjectListCollection
public static RdfPredicateObjectListCollection predicateObjectListCollection(IRI predicate, RdfObject... objects) Create aRdfPredicateObjectListCollection
with an initialRdfPredicateObjectList
- Parameters:
predicate
- theRdfPredicate
of the initialRdfPredicateObjectList
objects
- theRdfObject
(s) of the initialRdfPredicateObjectList
- Returns:
- a new
RdfPredicateObjectListCollection
-
predicateObjectListCollection
public static RdfPredicateObjectListCollection predicateObjectListCollection(RdfPredicateObjectList... predicateObjectLists) Create aRdfPredicateObjectListCollection
with the givenRdfPredicateObjectList
(s)- Parameters:
predicateObjectLists
- theRdfPredicateObjectList
(s) to add to the collection- Returns:
- a new
RdfPredicateObjectListCollection
-
objects
-
object
-
toRdfLiteralArray
Convert an array ofString
s to an array ofRdfLiteral.StringLiteral
s- Parameters:
literals
- theString
s to convert- Returns:
- an array of the corresponding
RdfLiteral.StringLiteral
s
-
toRdfLiteralArray
Convert an array ofBoolean
s to an array ofRdfLiteral.BooleanLiteral
s- Parameters:
literals
- theBoolean
s to convert- Returns:
- an array of the corresponding
RdfLiteral.BooleanLiteral
s
-
toRdfLiteralArray
Convert an array ofNumber
s to an array ofRdfLiteral.NumericLiteral
s- Parameters:
literals
- theNumber
s to convert- Returns:
- an array of the corresponding
RdfLiteral.NumericLiteral
s
-