Interface RdfTermFactory
-
- All Known Implementing Classes:
TermHashMap
public interface RdfTermFactoryA factory interface for creating RDF terms such as resources, literals, triples, and quads.This interface provides methods to create different types of RDF terms, which are the building blocks of RDF statements (triples and quads). These methods help in constructing RDF resources, literals, and structured statements (triples and quads) that can be used in RDF graphs or datasets.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RdfResourcecreateBlankNode(java.lang.String value)Creates a blank node with the specified value.RdfResourcecreateIRI(java.lang.String value)Creates an IRI (Internationalized Resource Identifier) with the specified value.RdfLiteralcreateLangString(java.lang.String lexicalValue, java.lang.String datatype, java.lang.String langTag, RdfLiteral.Direction direction)Creates an RDF language-tagged string with the specified lexical value, datatype, and language tag.RdfLiteralcreateLiteral(java.lang.String lexicalValue, java.lang.String datatype)Creates an RDF literal with the specified lexical value and datatype.RdfQuadcreateQuad(RdfResource subject, RdfResource predicate, RdfTerm object, RdfResource graph)Creates a quad consisting of a subject, predicate, object, and graph.RdfTriplecreateTriple(RdfResource subject, RdfResource predicate, RdfTerm object)Creates a triple consisting of a subject, predicate, and object.
-
-
-
Method Detail
-
createBlankNode
RdfResource createBlankNode(java.lang.String value)
Creates a blank node with the specified value.A blank node is an anonymous resource that does not have an IRI.
- Parameters:
value- the value of the blank node (usually a string identifier)- Returns:
RdfResourcerepresenting the blank node
-
createIRI
RdfResource createIRI(java.lang.String value)
Creates an IRI (Internationalized Resource Identifier) with the specified value.An IRI is a globally unique identifier used to refer to a resource.
- Parameters:
value- the value of the IRI (usually a URI string)- Returns:
RdfResourcerepresenting the IRI
-
createTriple
RdfTriple createTriple(RdfResource subject, RdfResource predicate, RdfTerm object)
Creates a triple consisting of a subject, predicate, and object.A triple is the core structure of RDF data, consisting of a subject, predicate, and object.
- Parameters:
subject- the subject of the triple, must be aRdfResourcepredicate- the predicate of the triple, must be aRdfResourceobject- the object of the triple, can be anyRdfTerm- Returns:
RdfTriplerepresenting the RDF triple
-
createQuad
RdfQuad createQuad(RdfResource subject, RdfResource predicate, RdfTerm object, RdfResource graph)
Creates a quad consisting of a subject, predicate, object, and graph.A quad extends the triple structure by including an additional graph name, allowing RDF data to be associated with a specific graph.
- Parameters:
subject- the subject of the quad, must be aRdfResourcepredicate- the predicate of the quad, must be aRdfResourceobject- the object of the quad, can be anyRdfTermgraph- the graph name for the quad, must be aRdfResource- Returns:
RdfQuadrepresenting the RDF quad
-
createLiteral
RdfLiteral createLiteral(java.lang.String lexicalValue, java.lang.String datatype)
Creates an RDF literal with the specified lexical value and datatype.RDF literals are used to represent values like strings, numbers, and dates.
- Parameters:
lexicalValue- the lexical value of the literal (e.g., "42", "hello")datatype- the datatype of the literal (e.g., xsd:string, xsd:int)- Returns:
RdfLiteralrepresenting the RDF literal
-
createLangString
RdfLiteral createLangString(java.lang.String lexicalValue, java.lang.String datatype, java.lang.String langTag, RdfLiteral.Direction direction)
Creates an RDF language-tagged string with the specified lexical value, datatype, and language tag.Language-tagged strings are literals that also have a language tag, e.g., "hello"@en for English.
- Parameters:
lexicalValue- the lexical value of the language-tagged stringdatatype- the datatype of the literal (should berdf:langString)langTag- the language tag (e.g., "en", "fr")direction- the text direction of the string (LTR or RTL)- Returns:
RdfLiteralrepresenting the language-tagged string
-
-