public class RDFModelImpl extends BaseRDFModelImpl implements RDFModel
Modifier and Type | Field and Description |
---|---|
protected BaseRDFTripleModel |
baseRep |
Constructor and Description |
---|
RDFModelImpl(BaseRDFTripleModel baseRep) |
Modifier and Type | Method and Description |
---|---|
void |
addInstance(String uri,
ARTResource cls,
ARTResource... graphs)
/* ADD/REMOVE METHODS ***
|
void |
addProperty(String propertyURI,
ARTURIResource superProperty,
ARTResource... graphs)
adds a resource with uri=
propertyURI as an rdf:PropertyThe new property is defined as subproperty of suprtProperty (unless this last is
null ) |
void |
addRDF(File inputFile,
String baseURI,
RDFFormat rdfFormat,
ARTResource... graphs)
adds RDF data to graphs
graphs by loading it from inputfile inputFile . |
void |
addRDF(URL url,
String baseURI,
RDFFormat rdfFormat,
ARTResource... graphs)
adds RDF data to graphs
graphs by loading it from url url . |
void |
addStatement(ARTStatement stat,
ARTResource... graphs)
add statement
stat to graphs graphs |
void |
addTriple(ARTResource subject,
ARTURIResource predicate,
ARTNode object,
ARTResource... graphs)
adds the specified triple to graphs
graphs |
void |
addType(ARTResource ind,
ARTResource cls,
ARTResource... graphs)
adds a type to resource
res |
void |
clearRDF(ARTResource... graphs)
completely clears any RDF statement from the specified graphs
|
void |
close()
closes the current model, releasing its resources
|
ARTBNode |
createBNode()
this method just generates a POJO wrapping a blank node for the ontology.
|
ARTBNode |
createBNode(String ID)
this method just generates a POJO wrapping a blank node for the ontology.
|
BooleanQuery |
createBooleanQuery(QueryLanguage ql,
String query)
as for
TripleQueryModel.createBooleanQuery(QueryLanguage, String, String) with baseuri set on
the baseuri of the ontology managed by this model |
BooleanQuery |
createBooleanQuery(QueryLanguage ql,
String query,
String baseURI)
creates a boolean query.
|
BooleanQuery |
createBooleanQuery(String query)
as for
TripleQueryModel.createBooleanQuery(QueryLanguage, String, String) with QueryLanguage=
QueryLanguage.SPARQL and baseuri set on the baseuri of the ontology managed by this model |
BooleanQuery |
createBooleanQuery(String query,
String baseURI)
as for
TripleQueryModel.createBooleanQuery(QueryLanguage, String, String) with QueryLanguage=
QueryLanguage.SPARQL |
GraphQuery |
createGraphQuery(QueryLanguage ql,
String query)
as for
TripleQueryModel.createGraphQuery(QueryLanguage, String, String) with baseuri set on the
baseuri of the ontology managed by this model |
GraphQuery |
createGraphQuery(QueryLanguage ql,
String query,
String baseURI)
creates a graph query.
|
GraphQuery |
createGraphQuery(String query)
as for
TripleQueryModel.createGraphQuery(QueryLanguage, String, String) with QueryLanguage=
QueryLanguage.SPARQL and baseuri set on the baseuri of the ontology managed by this model |
GraphQuery |
createGraphQuery(String query,
String baseURI)
as for
TripleQueryModel.createGraphQuery(QueryLanguage, String, String) with QueryLanguage=
QueryLanguage.SPARQL |
ARTLiteral |
createLiteral(String literalString)
creates a literal from its string representation
|
ARTLiteral |
createLiteral(String literalString,
ARTURIResource datatype)
composes an creates a literal with a given datatype
|
ARTLiteral |
createLiteral(String literalString,
String language)
composes and creates a literal starting from its base label and the assigned language
|
Query |
createQuery(QueryLanguage ql,
String query)
as for
TripleQueryModel.createQuery(QueryLanguage, String, String) with baseuri set on the
baseuri of the ontology managed by this model |
Query |
createQuery(QueryLanguage ql,
String query,
String baseURI)
creates a generic query.
|
Query |
createQuery(String query)
as for
TripleQueryModel.createQuery(QueryLanguage, String, String) with QueryLanguage=
QueryLanguage.SPARQL and baseuri set on the baseuri of the ontology managed by this model |
Query |
createQuery(String query,
String baseURI)
as for
TripleQueryModel.createQuery(QueryLanguage, String, String) with QueryLanguage=
QueryLanguage.SPARQL |
ARTStatement |
createStatement(ARTResource subject,
ARTURIResource predicate,
ARTNode object)
this method just generates a POJO wrapping a statement for the ontology.
|
TupleQuery |
createTupleQuery(QueryLanguage ql,
String query)
as for
TripleQueryModel.createTupleQuery(QueryLanguage, String, String) with baseuri set on the
baseuri of the ontology managed by this model |
TupleQuery |
createTupleQuery(QueryLanguage ql,
String query,
String baseURI)
creates a tuple query.
|
TupleQuery |
createTupleQuery(String query)
as for
TripleQueryModel.createTupleQuery(QueryLanguage, String, String) with QueryLanguage=
QueryLanguage.SPARQL and baseuri set on the baseuri of the ontology managed by this model |
TupleQuery |
createTupleQuery(String query,
String baseURI)
as for
TripleQueryModel.createTupleQuery(QueryLanguage, String, String) with QueryLanguage=
QueryLanguage.SPARQL |
Update |
createUpdate(QueryLanguage ql,
String query,
String baseURI)
creates an update query.
|
Update |
createUpdateQuery(QueryLanguage ql,
String query)
as for
TripleQueryModel.createUpdate(QueryLanguage, String, String) with baseuri set on
the baseuri of the ontology managed by this model |
Update |
createUpdateQuery(String query)
as for
TripleQueryModel.createUpdate(QueryLanguage, String, String) with QueryLanguage=
QueryLanguage.SPARQL and baseuri set on the baseuri of the ontology managed by this model |
Update |
createUpdateQuery(String query,
String baseURI)
as for
TripleQueryModel.createUpdate(QueryLanguage, String, String) with QueryLanguage=
QueryLanguage.SPARQL |
ARTURIResource |
createURIResource(String uri)
this method just generates a POJO wrapping an URI for the ontology.
|
void |
deleteProperty(ARTURIResource res,
ARTResource... graphs)
deletes a property
|
void |
deleteResource(ARTResource res,
ARTResource... graphs)
DELETE METHODS *****
|
void |
deleteStatement(ARTStatement statement,
ARTResource... graphs)
deletes the specified statement from graphs
graphs |
void |
deleteTriple(ARTResource subject,
ARTURIResource property,
ARTNode object,
ARTResource... graphs)
deletes the triple identified by <
subject , property , object
> from the specified graphs |
boolean |
existsResource(ARTResource res,
ARTResource... graphs) |
String |
expandQName(String qname)
Expand a qname into an uri using the prefix mappings, if a prefix is available.
|
String |
getBaseURI()
returns the baseuri of the ontology managed by this model
|
String |
getDefaultNamespace()
returns the default namespace of the ontology managed by this model
|
Map<String,String> |
getNamespacePrefixMapping()
Return a copy of the internal mapping from prefixes to namespaces (as strings).
|
String |
getNSForPrefix(String prefix)
Gets the URI bound to a specific prefix, null if there isn't one.
|
String |
getPrefixForNS(String namespace)
Answer the prefix for the given URI, or null if there isn't one.
|
String |
getQName(String uri)
Compress the URI into a qname using the prefix mappings, if a prefix is available.
|
boolean |
hasStatement(ARTStatement stat,
boolean inferred,
ARTResource... graphs)
checks that the specified statement is present in this model, inside one of the graphs specified in
graphs |
boolean |
hasTriple(ARTResource subj,
ARTURIResource pred,
ARTNode obj,
boolean inferred,
ARTResource... graphs)
checks that the triple identified by <
subj , pred , obj > is
present in this model, inside one of the graphs specified in graphs |
boolean |
hasType(ARTResource ind,
ARTResource type,
boolean inferred,
ARTResource... graphs)
/* BOOLEAN METHODS ***
|
void |
instantiatePropertyWithPlainLiteral(ARTResource subject,
ARTURIResource predicate,
String value,
ARTResource... graphs)
creates a triple for the given
subject , predicate and value by using a plain literal with no language tag as the object |
void |
instantiatePropertyWithPlainLiteral(ARTResource subject,
ARTURIResource predicate,
String value,
String lang,
ARTResource... graphs)
creates a triple for the given
subject , predicate and value by using a plain literal with a language tag as the object |
void |
instantiatePropertyWithResource(ARTResource subject,
ARTURIResource predicate,
ARTResource object,
ARTResource... graphs)
creates a triple for the given
subject , predicate and object just a mere rewriting of addTriple with the object constrained to be a Resource |
void |
instantiatePropertyWithTypedLiteral(ARTResource subject,
ARTURIResource property,
String value,
ARTURIResource datatype,
ARTResource... graphs)
creates a triple for the given
subject , predicate and object, which is
described by its label (value ) and (datatype ) |
boolean |
isLocallyDefined(ARTResource res,
ARTResource... graphs)
Checks whether there exists an explicit triple in any of the
provided graphs the subject of which is the provided resource
res.
|
boolean |
isProperty(ARTResource prop,
ARTResource... graphs)
checks that resource
prop is a propertyIf available, reasoning is activated by default, so all kind of properties should be properly checked by this method |
ARTResourceIterator |
listInstances(ARTResource res,
boolean inferred,
ARTResource... graphs)
retrieves all instances of class
type |
ARTResourceIterator |
listNamedGraphs()
returns an
ARTResourceIterator over the namedgraphs declared in the global RDF graph |
ARTURIResourceIterator |
listNamedInstances(ARTResource... graphs) |
ARTNamespaceIterator |
listNamespaces()
list all namespaces used in this model
|
ARTURIResourceIterator |
listPredicatesOfSubjObjPair(ARTResource subject,
ARTNode object,
boolean inferred,
ARTResource... graphs)
list all uri resources which appear as predicates of statements having given
subject and
object |
ARTURIResourceIterator |
listProperties(ARTResource... graphs)
/* LIST/GET METHODS ***
|
ARTStatementIterator |
listStatements(ARTResource subj,
ARTURIResource pred,
ARTNode obj,
boolean inferred,
ARTResource... graphs)
returns statements which unify with triples containing
subj , pred and
obj in their respective positions. |
ARTResourceIterator |
listSubjectsOfPredObjPair(ARTURIResource predicate,
ARTNode object,
boolean inferred,
ARTResource... graphs)
list all resources which appear as subjects of statements having given
predicate and
object |
ARTResourceIterator |
listTypes(ARTResource res,
boolean inferred,
ARTResource... graphs)
retrieves all classes which are types for resource
res |
ARTNodeIterator |
listValuesOfSubjPredPair(ARTResource subject,
ARTURIResource predicate,
boolean inferred,
ARTResource... graphs)
list all nodes which appear as objects of statements having given
subject and
predicate |
void |
removeNsPrefixMapping(String namespace)
Removes prefix/namespace mapping
|
void |
removeType(ARTResource ind,
ARTResource cls,
ARTResource... graphs)
removes the rdf:type relationship between
res and cls |
void |
renameProperty(ARTURIResource oldProperty,
String newPropertyURI,
ARTResource... graphs)
RENAME METHODS *****
|
void |
renameResource(ARTURIResource oldResource,
String newResourceURI,
ARTResource... graphs)
renames a resource
|
ARTBNode |
retrieveBNode(String ID,
ARTResource... graphs)
Contract for this method is:
If there exist a triple in the specified graphs graphs where a blank node with id=
ID is mentioned, then return that blank node, otherwise return null |
ARTURIResource |
retrieveURIResource(String uri,
ARTResource... graphs)
/* RETRIEVE METHODS ***
|
void |
setBaseURI(String uri)
sets the baseuri for the ontology managed by this model
|
void |
setDefaultNamespace(String namespace)
sets the default namespace for the ontology managed by this model
|
void |
setNsPrefix(String namespace,
String prefix)
Specify the prefix name for a URI prefix string.
|
void |
writeRDF(File outputFile,
RDFFormat rdfFormat,
ARTResource... graphs)
writes RDF data from graphs
graphs into file outputFile . |
void |
writeRDF(OutputStream os,
RDFFormat rdfFormat,
ARTResource... graphs)
writes RDF data from graphs
graphs to output stream os . |
void |
writeRDF(RDFIterator<ARTStatement> it,
RDFFormat format,
OutputStream out)
writes an RDFIterator of statements to output stream and then closes it.
|
void |
writeRDF(RDFIterator<ARTStatement> it,
RDFFormat format,
Writer wout)
manages an RDFIterator of statements to be serialized according to the specified format, and passes it
to the chosen writer.
|
protected BaseRDFTripleModel baseRep
public RDFModelImpl(BaseRDFTripleModel baseRep)
public void addInstance(String uri, ARTResource cls, ARTResource... graphs) throws ModelUpdateException
addInstance
in interface RDFModel
ModelUpdateException
public void addProperty(String propertyURI, ARTURIResource superProperty, ARTResource... graphs) throws ModelUpdateException
RDFModel
propertyURI
as an rdf:PropertysuprtProperty
(unless this last is
null
)addProperty
in interface RDFModel
ModelUpdateException
public void addType(ARTResource ind, ARTResource cls, ARTResource... graphs) throws ModelUpdateException
RDFModel
res
addType
in interface RDFModel
ModelUpdateException
public void removeType(ARTResource ind, ARTResource cls, ARTResource... graphs) throws ModelUpdateException
RDFModel
res
and cls
removeType
in interface RDFModel
ModelUpdateException
public void instantiatePropertyWithPlainLiteral(ARTResource subject, ARTURIResource predicate, String value, ARTResource... graphs) throws ModelUpdateException
RDFModel
subject
, predicate
and value
instantiatePropertyWithPlainLiteral
in interface RDFModel
ModelUpdateException
public void instantiatePropertyWithPlainLiteral(ARTResource subject, ARTURIResource predicate, String value, String lang, ARTResource... graphs) throws ModelUpdateException
RDFModel
subject
, predicate
and value
instantiatePropertyWithPlainLiteral
in interface RDFModel
ModelUpdateException
public void instantiatePropertyWithTypedLiteral(ARTResource subject, ARTURIResource property, String value, ARTURIResource datatype, ARTResource... graphs) throws ModelUpdateException
RDFModel
subject
, predicate
and object, which is
described by its label (value
) and (datatype
)instantiatePropertyWithTypedLiteral
in interface RDFModel
ModelUpdateException
public void instantiatePropertyWithResource(ARTResource subject, ARTURIResource predicate, ARTResource object, ARTResource... graphs) throws ModelUpdateException
RDFModel
subject
, predicate
and object
instantiatePropertyWithResource
in interface RDFModel
ModelUpdateException
public boolean hasType(ARTResource ind, ARTResource type, boolean inferred, ARTResource... graphs) throws ModelAccessException
hasType
in interface RDFModel
ModelAccessException
public boolean isProperty(ARTResource prop, ARTResource... graphs) throws ModelAccessException
RDFModel
prop
is a propertyisProperty
in interface RDFModel
ModelAccessException
public ARTURIResource retrieveURIResource(String uri, ARTResource... graphs) throws ModelAccessException
retrieveURIResource
in interface RDFModel
ModelAccessException
UnavailableResourceException
public ARTBNode retrieveBNode(String ID, ARTResource... graphs) throws ModelAccessException
RDFModel
graphs
where a blank node with id=
ID
is mentioned, then return that blank node, otherwise return null
retrieveBNode
in interface RDFModel
ModelAccessException
public boolean isLocallyDefined(ARTResource res, ARTResource... graphs) throws ModelAccessException
RDFModel
isLocallyDefined
in interface RDFModel
ModelAccessException
public boolean existsResource(ARTResource res, ARTResource... graphs) throws ModelAccessException
existsResource
in interface RDFModel
ModelAccessException
public ARTURIResourceIterator listProperties(ARTResource... graphs) throws ModelAccessException
listProperties
in interface RDFModel
ModelAccessException
public ARTResourceIterator listTypes(ARTResource res, boolean inferred, ARTResource... graphs) throws ModelAccessException
RDFModel
res
listTypes
in interface RDFModel
ModelAccessException
public ARTResourceIterator listInstances(ARTResource res, boolean inferred, ARTResource... graphs) throws ModelAccessException
RDFModel
type
listInstances
in interface RDFModel
ModelAccessException
public ARTURIResourceIterator listNamedInstances(ARTResource... graphs) throws ModelAccessException
listNamedInstances
in interface RDFModel
ModelAccessException
public void deleteResource(ARTResource res, ARTResource... graphs) throws ModelUpdateException
deleteResource
in interface RDFModel
ModelUpdateException
public void deleteProperty(ARTURIResource res, ARTResource... graphs) throws ModelUpdateException
RDFModel
deleteProperty
in interface RDFModel
ModelUpdateException
public void renameProperty(ARTURIResource oldProperty, String newPropertyURI, ARTResource... graphs) throws ModelUpdateException
renameProperty
in interface RDFModel
ModelUpdateException
public void renameResource(ARTURIResource oldResource, String newResourceURI, ARTResource... graphs) throws ModelUpdateException
RDFModel
renameResource
in interface RDFModel
ModelUpdateException
public BooleanQuery createBooleanQuery(String query) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createBooleanQuery(QueryLanguage, String, String)
with QueryLanguage=
QueryLanguage.SPARQL
and baseuri set on the baseuri of the ontology managed by this modelcreateBooleanQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public BooleanQuery createBooleanQuery(String query, String baseURI) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createBooleanQuery(QueryLanguage, String, String)
with QueryLanguage=
QueryLanguage.SPARQL
createBooleanQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public BooleanQuery createBooleanQuery(QueryLanguage ql, String query) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createBooleanQuery(QueryLanguage, String, String)
with baseuri set on
the baseuri of the ontology managed by this modelcreateBooleanQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public GraphQuery createGraphQuery(String query) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createGraphQuery(QueryLanguage, String, String)
with QueryLanguage=
QueryLanguage.SPARQL
and baseuri set on the baseuri of the ontology managed by this modelcreateGraphQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public GraphQuery createGraphQuery(String query, String baseURI) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createGraphQuery(QueryLanguage, String, String)
with QueryLanguage=
QueryLanguage.SPARQL
createGraphQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public GraphQuery createGraphQuery(QueryLanguage ql, String query) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createGraphQuery(QueryLanguage, String, String)
with baseuri set on the
baseuri of the ontology managed by this modelcreateGraphQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public Query createQuery(String query) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createQuery(QueryLanguage, String, String)
with QueryLanguage=
QueryLanguage.SPARQL
and baseuri set on the baseuri of the ontology managed by this modelcreateQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public Query createQuery(String query, String baseURI) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createQuery(QueryLanguage, String, String)
with QueryLanguage=
QueryLanguage.SPARQL
createQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public Query createQuery(QueryLanguage ql, String query) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createQuery(QueryLanguage, String, String)
with baseuri set on the
baseuri of the ontology managed by this modelcreateQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public TupleQuery createTupleQuery(String query) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createTupleQuery(QueryLanguage, String, String)
with QueryLanguage=
QueryLanguage.SPARQL
and baseuri set on the baseuri of the ontology managed by this modelcreateTupleQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public TupleQuery createTupleQuery(String query, String baseURI) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createTupleQuery(QueryLanguage, String, String)
with QueryLanguage=
QueryLanguage.SPARQL
createTupleQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public TupleQuery createTupleQuery(QueryLanguage ql, String query) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createTupleQuery(QueryLanguage, String, String)
with baseuri set on the
baseuri of the ontology managed by this modelcreateTupleQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public Update createUpdate(QueryLanguage ql, String query, String baseURI) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
TripleQueryModel
createUpdate
in interface TripleQueryModel
ql
- the query languagequery
- the text content of the querybaseURI
- the baseuri to be considered for relative resources' names in the given queryUnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public Update createUpdateQuery(String query) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createUpdate(QueryLanguage, String, String)
with QueryLanguage=
QueryLanguage.SPARQL
and baseuri set on the baseuri of the ontology managed by this modelcreateUpdateQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public Update createUpdateQuery(String query, String baseURI) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createUpdate(QueryLanguage, String, String)
with QueryLanguage=
QueryLanguage.SPARQL
createUpdateQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public Update createUpdateQuery(QueryLanguage ql, String query) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
SPARQLQueryModel
TripleQueryModel.createUpdate(QueryLanguage, String, String)
with baseuri set on
the baseuri of the ontology managed by this modelcreateUpdateQuery
in interface SPARQLQueryModel
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public void addRDF(File inputFile, String baseURI, RDFFormat rdfFormat, ARTResource... graphs) throws FileNotFoundException, IOException, ModelAccessException, ModelUpdateException, UnsupportedRDFFormatException
BaseRDFTripleModel
graphs
by loading it from inputfile inputFile
. Data
in the file must be formatted according to the specified rdfFormat
. The specified
baseURI
is used for those formats where relative resource names are present and the
baseuri is not present in the file.addRDF
in interface BaseRDFTripleModel
FileNotFoundException
IOException
ModelAccessException
ModelUpdateException
UnsupportedRDFFormatException
public void addRDF(URL url, String baseURI, RDFFormat rdfFormat, ARTResource... graphs) throws FileNotFoundException, IOException, ModelAccessException, ModelUpdateException, UnsupportedRDFFormatException
BaseRDFTripleModel
graphs
by loading it from url url
. Data in the file
must be formatted according to the specified rdfFormat
. The specified baseURI
is used for those formats where relative resource names are present and the baseuri is not present in
the file.RDFFormat.getMIMEType()
method.addRDF
in interface BaseRDFTripleModel
rdfFormat
- if null
, then content format sent must be inferred from the server responseFileNotFoundException
IOException
ModelAccessException
ModelUpdateException
UnsupportedRDFFormatException
public void addStatement(ARTStatement stat, ARTResource... graphs) throws ModelUpdateException
BaseRDFTripleModel
stat
to graphs graphs
addStatement
in interface BaseRDFTripleModel
ModelUpdateException
public void addTriple(ARTResource subject, ARTURIResource predicate, ARTNode object, ARTResource... graphs) throws ModelUpdateException
BaseRDFTripleModel
graphs
addTriple
in interface BaseRDFTripleModel
ModelUpdateException
public void clearRDF(ARTResource... graphs) throws ModelUpdateException
BaseRDFTripleModel
clearRDF
in interface BaseRDFTripleModel
ModelUpdateException
public void close() throws ModelUpdateException
BaseRDFTripleModel
close
in interface BaseRDFTripleModel
ModelUpdateException
public ARTBNode createBNode()
ARTNodeFactory
createBNode
in interface ARTNodeFactory
public ARTBNode createBNode(String ID)
ARTNodeFactory
createBNode
in interface ARTNodeFactory
ID
- an internal identifier which can be used to retrieve the blank node, if knownpublic BooleanQuery createBooleanQuery(QueryLanguage ql, String query, String baseURI) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
TripleQueryModel
createBooleanQuery
in interface TripleQueryModel
ql
- the query languagequery
- the text content of the querybaseURI
- the baseuri to be considered for relative resources' names in the given queryUnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public GraphQuery createGraphQuery(QueryLanguage ql, String query, String baseURI) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
TripleQueryModel
createGraphQuery
in interface TripleQueryModel
ql
- the query languagequery
- the text content of the querybaseURI
- the baseuri to be considered for relative resources' names in the given queryUnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public ARTLiteral createLiteral(String literalString, ARTURIResource datatype)
ARTNodeFactory
createLiteral
in interface ARTNodeFactory
public ARTLiteral createLiteral(String literalString, String language)
ARTNodeFactory
createLiteral
in interface ARTNodeFactory
public ARTLiteral createLiteral(String literalString)
ARTNodeFactory
createLiteral
in interface ARTNodeFactory
public ARTStatement createStatement(ARTResource subject, ARTURIResource predicate, ARTNode object)
ARTNodeFactory
createStatement
in interface ARTNodeFactory
public Query createQuery(QueryLanguage ql, String query, String baseURI) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
TripleQueryModel
query
)createQuery
in interface TripleQueryModel
ql
- the query languagequery
- the text content of the querybaseURI
- the baseuri to be considered for relative resources' names in the given queryUnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public TupleQuery createTupleQuery(QueryLanguage ql, String query, String baseURI) throws UnsupportedQueryLanguageException, ModelAccessException, MalformedQueryException
TripleQueryModel
createTupleQuery
in interface TripleQueryModel
ql
- the query languagequery
- the text content of the querybaseURI
- the baseuri to be considered for relative resources' names in the given queryUnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public ARTURIResource createURIResource(String uri)
ARTNodeFactory
createURIResource
in interface ARTNodeFactory
public void deleteStatement(ARTStatement statement, ARTResource... graphs) throws ModelUpdateException
BaseRDFTripleModel
graphs
deleteStatement
in interface BaseRDFTripleModel
ModelUpdateException
public void deleteTriple(ARTResource subject, ARTURIResource property, ARTNode object, ARTResource... graphs) throws ModelUpdateException
BaseRDFTripleModel
subject
, property
, object
> from the specified graphs
deleteTriple
in interface BaseRDFTripleModel
ModelUpdateException
public String expandQName(String qname) throws ModelAccessException
PrefixMapping
expandQName
in interface PrefixMapping
ModelAccessException
public String getBaseURI()
BaseRDFTripleModel
getBaseURI
in interface BaseRDFTripleModel
public String getDefaultNamespace()
BaseRDFTripleModel
getDefaultNamespace
in interface BaseRDFTripleModel
public Map<String,String> getNamespacePrefixMapping() throws ModelAccessException
PrefixMapping
getNamespacePrefixMapping
in interface PrefixMapping
ModelAccessException
public String getNSForPrefix(String prefix) throws ModelAccessException
PrefixMapping
getNSForPrefix
in interface PrefixMapping
ModelAccessException
public String getPrefixForNS(String namespace) throws ModelAccessException
PrefixMapping
getPrefixForNS
in interface PrefixMapping
ModelAccessException
public String getQName(String uri) throws ModelAccessException
PrefixMapping
getQName
in interface PrefixMapping
ModelAccessException
public boolean hasStatement(ARTStatement stat, boolean inferred, ARTResource... graphs) throws ModelAccessException
BaseRDFTripleModel
graphs
hasStatement
in interface BaseRDFTripleModel
stat
- the statement which is checked inside the modelinferred
- tells if the inference engine of the model is to be used for this retrieval operationgraphs
- the graphs where to look for the specified statementModelAccessException
public boolean hasTriple(ARTResource subj, ARTURIResource pred, ARTNode obj, boolean inferred, ARTResource... graphs) throws ModelAccessException
BaseRDFTripleModel
subj
, pred
, obj
> is
present in this model, inside one of the graphs specified in graphs
hasTriple
in interface BaseRDFTripleModel
subj
- the subject of the triplepred
- the predicate of the tripleobj
- the object of the tripleinferred
- tells if the inference engine of the model is to be used for this retrieval operationgraphs
- the graphs where to look for the specified tripleModelAccessException
public ARTResourceIterator listNamedGraphs() throws ModelAccessException
BaseRDFTripleModel
ARTResourceIterator
over the namedgraphs declared in the global RDF graphlistNamedGraphs
in interface BaseRDFTripleModel
ModelAccessException
public ARTNamespaceIterator listNamespaces() throws ModelAccessException
BaseRDFTripleModel
listNamespaces
in interface BaseRDFTripleModel
ModelAccessException
public ARTURIResourceIterator listPredicatesOfSubjObjPair(ARTResource subject, ARTNode object, boolean inferred, ARTResource... graphs) throws ModelAccessException
BaseRDFTripleModel
subject
and
object
listPredicatesOfSubjObjPair
in interface BaseRDFTripleModel
listPredicatesOfSubjObjPair
in class BaseRDFModelImpl
ModelAccessException
public ARTStatementIterator listStatements(ARTResource subj, ARTURIResource pred, ARTNode obj, boolean inferred, ARTResource... graphs) throws ModelAccessException
BaseRDFTripleModel
subj
, pred
and
obj
in their respective positions. A NodeFilters.ANY
value in one of these
positions is equivalent to putting a wildcard in that position.listStatements
in interface BaseRDFTripleModel
subj
- the subject of the triplepred
- the predicate of the tripleobj
- the object of the tripleModelAccessException
public ARTResourceIterator listSubjectsOfPredObjPair(ARTURIResource predicate, ARTNode object, boolean inferred, ARTResource... graphs) throws ModelAccessException
BaseRDFTripleModel
predicate
and
object
listSubjectsOfPredObjPair
in interface BaseRDFTripleModel
listSubjectsOfPredObjPair
in class BaseRDFModelImpl
ModelAccessException
public ARTNodeIterator listValuesOfSubjPredPair(ARTResource subject, ARTURIResource predicate, boolean inferred, ARTResource... graphs) throws ModelAccessException
BaseRDFTripleModel
subject
and
predicate
listValuesOfSubjPredPair
in interface BaseRDFTripleModel
listValuesOfSubjPredPair
in class BaseRDFModelImpl
ModelAccessException
public void removeNsPrefixMapping(String namespace) throws ModelUpdateException
PrefixMapping
removeNsPrefixMapping
in interface PrefixMapping
ModelUpdateException
public void setBaseURI(String uri) throws ModelUpdateException
BaseRDFTripleModel
setBaseURI
in interface BaseRDFTripleModel
ModelUpdateException
public void setDefaultNamespace(String namespace) throws ModelUpdateException
BaseRDFTripleModel
setDefaultNamespace
in interface BaseRDFTripleModel
ModelUpdateException
public void setNsPrefix(String namespace, String prefix) throws ModelUpdateException
PrefixMapping
setNsPrefix
in interface PrefixMapping
ModelUpdateException
public void writeRDF(File outputFile, RDFFormat rdfFormat, ARTResource... graphs) throws IOException, ModelAccessException, UnsupportedRDFFormatException
BaseRDFTripleModel
graphs
into file outputFile
. Data in the file
will be formatted according to the specified rdfFormat
.writeRDF
in interface BaseRDFTripleModel
IOException
ModelAccessException
UnsupportedRDFFormatException
public void writeRDF(OutputStream os, RDFFormat rdfFormat, ARTResource... graphs) throws IOException, ModelAccessException, UnsupportedRDFFormatException
BaseRDFTripleModel
graphs
to output stream os
. Data in the file will
be formatted according to the specified rdfFormat
.writeRDF
in interface BaseRDFTripleModel
IOException
ModelAccessException
UnsupportedRDFFormatException
public void writeRDF(RDFIterator<ARTStatement> it, RDFFormat format, OutputStream out) throws ModelAccessException, UnsupportedRDFFormatException, IOException
RDFSerializer
writeRDF
in interface RDFSerializer
ModelAccessException
UnsupportedRDFFormatException
IOException
public void writeRDF(RDFIterator<ARTStatement> it, RDFFormat format, Writer wout) throws ModelAccessException, UnsupportedRDFFormatException, IOException
RDFSerializer
writeRDF
in interface RDFSerializer
ModelAccessException
UnsupportedRDFFormatException
IOException
Copyright © 2015 ART Group, University of Rome, Tor Vergata. All Rights Reserved.