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 IriCreate a SparqlBuilder Iri instance from a String iristatic IriCreate a SparqlBuilder Iri instance from a namespace and local namestatic IriCreate a SparqlBuilder Iri instance from anIRIstatic RdfLiteral.BooleanLiteralcreate an RDF boolean literalstatic RdfLiteral.NumericLiteralcreate an RDF numeric literalstatic RdfLiteral.StringLiteralcreate 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 RdfObjectstatic RdfObject[]static RdfPredicateObjectListpredicateObjectList(IRI predicate, RdfObject... objects) Create aRdfPredicateObjectListstatic RdfPredicateObjectListpredicateObjectList(RdfPredicate predicate, RdfObject... objects) Create aRdfPredicateObjectListpredicateObjectListCollection(IRI predicate, RdfObject... objects) Create aRdfPredicateObjectListCollectionwith an initialRdfPredicateObjectListpredicateObjectListCollection(RdfPredicateObjectList... predicateObjectLists) Create aRdfPredicateObjectListCollectionwith the givenRdfPredicateObjectList(s)predicateObjectListCollection(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 Details
-
iri
Create a SparqlBuilder Iri instance from a String iri- Parameters:
iriString- the String representing the iri- Returns:
- the
Iriinstance
-
iri
Create a SparqlBuilder Iri instance from anIRI- Parameters:
iri- the IRI- Returns:
- the SparqlBuilder
Iriinstance
-
iri
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
creates a labeled blank node- Parameters:
label- the label of the blank node- Returns:
- a new
RdfBlankNode.LabeledBlankNodeinstance
-
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.PropertiesBlankNodeinstance - 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.PropertiesBlankNodeinstance - See Also:
-
bNode
create an empty anonymous blank node- Returns:
- an empty
RdfBlankNode.AnonymousBlankNodeinstance
-
literalOf
create an RDF string literal- Parameters:
stringValue- the String instance to create a literal from- Returns:
- a
RdfLiteral.StringLiteralinstance representing the given String
-
literalOfType
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
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
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
create an RDF numeric literal- Parameters:
numberValue- the Number instance to create a literal from- Returns:
- a
RdfLiteral.NumericLiteralinstance representing the given Number
-
literalOf
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
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
-
objects
-
object
-
toRdfLiteralArray
Convert an array ofStrings to an array ofRdfLiteral.StringLiterals- Parameters:
literals- theStrings to convert- Returns:
- an array of the corresponding
RdfLiteral.StringLiterals
-
toRdfLiteralArray
Convert an array ofBooleans to an array ofRdfLiteral.BooleanLiterals- Parameters:
literals- theBooleans to convert- Returns:
- an array of the corresponding
RdfLiteral.BooleanLiterals
-
toRdfLiteralArray
Convert an array ofNumbers to an array ofRdfLiteral.NumericLiterals- Parameters:
literals- theNumbers to convert- Returns:
- an array of the corresponding
RdfLiteral.NumericLiterals
-