Class Rdf
- java.lang.Object
-
- org.eclipse.rdf4j.sparqlbuilder.rdf.Rdf
-
public class Rdf extends Object
A class with static methods to create basicSparqlBuilder
RDF objects from either string values or RDF4J Model objects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RdfBlankNode.AnonymousBlankNode
bNode()
create an empty anonymous blank nodestatic RdfBlankNode.LabeledBlankNode
bNode(String label)
creates a labeled blank nodestatic RdfBlankNode.PropertiesBlankNode
bNode(IRI predicate, RdfObject... objects)
creates a label-less blank node, identified by the supplied predicate-object listsstatic RdfBlankNode.PropertiesBlankNode
bNode(RdfPredicate predicate, RdfObject... objects)
creates a label-less blank node, identified by the supplied predicate-object listsstatic Iri
iri(String iriString)
Create a SparqlBuilder Iri instance from a String iristatic Iri
iri(String namespace, String localName)
Create a SparqlBuilder Iri instance from a namespace and local namestatic Iri
iri(IRI iri)
Create a SparqlBuilder Iri instance from anIRI
static RdfLiteral.BooleanLiteral
literalOf(Boolean boolValue)
create an RDF boolean literalstatic RdfLiteral.NumericLiteral
literalOf(Number numberValue)
create an RDF numeric literalstatic RdfLiteral.StringLiteral
literalOf(String stringValue)
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
object(Value value)
static RdfObject[]
objects(Value... values)
static RdfPredicateObjectList
predicateObjectList(IRI predicate, RdfObject... objects)
Create aRdfPredicateObjectList
static RdfPredicateObjectList
predicateObjectList(RdfPredicate predicate, RdfObject... objects)
Create aRdfPredicateObjectList
static RdfPredicateObjectListCollection
predicateObjectListCollection(IRI predicate, RdfObject... objects)
Create aRdfPredicateObjectListCollection
with an initialRdfPredicateObjectList
static RdfPredicateObjectListCollection
predicateObjectListCollection(RdfPredicateObjectList... predicateObjectLists)
Create aRdfPredicateObjectListCollection
with the givenRdfPredicateObjectList
(s)static RdfPredicateObjectListCollection
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 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
Iri
instance
-
iri
public static Iri iri(IRI iri)
Create a SparqlBuilder Iri instance from anIRI
- Parameters:
iri
- the IRI- Returns:
- the SparqlBuilder
Iri
instance
-
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
Iri
instance
-
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.LabeledBlankNode
instance
-
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.PropertiesBlankNode
instance - 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.PropertiesBlankNode
instance - See Also:
- Blank node syntax
-
bNode
public static RdfBlankNode.AnonymousBlankNode bNode()
create an empty anonymous blank node- Returns:
- an empty
RdfBlankNode.AnonymousBlankNode
instance
-
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.StringLiteral
instance 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.StringLiteral
instance 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.StringLiteral
instance 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.StringLiteral
instance 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.NumericLiteral
instance 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.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
public static RdfPredicateObjectList predicateObjectList(IRI predicate, RdfObject... objects)
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
-
toRdfLiteralArray
public static RdfLiteral.StringLiteral[] toRdfLiteralArray(String... literals)
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
public static RdfLiteral.BooleanLiteral[] toRdfLiteralArray(Boolean... literals)
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
public static RdfLiteral.NumericLiteral[] toRdfLiteralArray(Number... literals)
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
-
-