public interface BaseRDFTripleModel extends PrefixMapping, TripleQueryModel, ARTNodeFactory, RDFSerializer
Legenda: (..., G1, G2, GN) written after the name of an operation means: all the standard arguments for that operation, followed by the set of name named graphs G1, G2...GN. So, for example, (...) means no NG is being specified.
NodeFilters.MAINGRAPH
)IllegalArgumentException
NodeFilters.ANY
)) throws an IllegalArgumentException
(ANY valid only
for read/delete)IllegalArgumentException
NodeFilters.ANY
)) list all statements from all NGs (as the previous
one)ARTResource
)null)) throws an IllegalArgumentException
NodeFilters.MAINGRAPH
)) retrieves stats from the UnnamedGraph (
NodeFilters.MAINGRAPH
)
NodeFilters.ANY
, when used as a NG, returns Statements from all NGs (i.e. from the unnamed NG and
all other NGs) but if you put both NodeFilters.ANY and another NG, you will get all statements only once
per each NG, ignoring all further NG specifications
es: given a graph composed of graphs: MAIN+ngA+ngB
listStatements(..., ngA, NodeFilters.ANY) returns all statements from all NGs (i.e. from the unnamed NG+ngA
and ngB), but will not return again stats from ngA even though it has been specified both directly and
undirectly through use of ANY
Modifier and Type | Method and Description |
---|---|
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 |
clearRDF(ARTResource... graphs)
completely clears any RDF statement from the specified graphs
|
void |
close()
closes the current model, releasing its resources
|
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 |
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
|
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 |
ARTResourceIterator |
listNamedGraphs()
returns an
ARTResourceIterator over the namedgraphs declared in the global RDF graph |
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 |
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 |
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 |
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 |
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 . |
expandQName, getNamespacePrefixMapping, getNSForPrefix, getPrefixForNS, getQName, removeNsPrefixMapping, setNsPrefix
createBooleanQuery, createGraphQuery, createQuery, createTupleQuery, createUpdate
createBNode, createBNode, createLiteral, createLiteral, createLiteral, createStatement, createURIResource
writeRDF, writeRDF
void addTriple(ARTResource subject, ARTURIResource predicate, ARTNode object, ARTResource... graphs) throws ModelUpdateException
graphs
subject
- predicate
- object
- graphs
- ModelUpdateException
void addStatement(ARTStatement stat, ARTResource... graphs) throws ModelUpdateException
stat
to graphs graphs
stat
- graphs
- ModelUpdateException
void setDefaultNamespace(String namespace) throws ModelUpdateException
namespace
- ModelUpdateException
void setBaseURI(String uri) throws ModelUpdateException
uri
- ModelUpdateException
String getDefaultNamespace()
String getBaseURI()
boolean hasTriple(ARTResource subj, ARTURIResource pred, ARTNode obj, boolean inferred, ARTResource... graphs) throws ModelAccessException
subj
, pred
, obj
> is
present in this model, inside one of the graphs specified in graphs
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
boolean hasStatement(ARTStatement stat, boolean inferred, ARTResource... graphs) throws ModelAccessException
graphs
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
ARTStatementIterator listStatements(ARTResource subj, ARTURIResource pred, ARTNode obj, boolean inferred, ARTResource... graphs) throws ModelAccessException
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.subj
- the subject of the triplepred
- the predicate of the tripleobj
- the object of the tripleModelAccessException
void deleteTriple(ARTResource subject, ARTURIResource property, ARTNode object, ARTResource... graphs) throws ModelUpdateException
subject
, property
, object
> from the specified graphs
subject
- property
- object
- graphs
- ModelUpdateException
void deleteStatement(ARTStatement statement, ARTResource... graphs) throws ModelUpdateException
graphs
statement
- graphs
- ModelUpdateException
void clearRDF(ARTResource... graphs) throws ModelUpdateException
ModelUpdateException
ARTNamespaceIterator listNamespaces() throws ModelAccessException
ModelAccessException
void addRDF(File inputFile, String baseURI, RDFFormat rdfFormat, ARTResource... graphs) throws FileNotFoundException, IOException, ModelAccessException, ModelUpdateException, UnsupportedRDFFormatException
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.inputFile
- baseURI
- rdfFormat
- graphs
- FileNotFoundException
IOException
ModelAccessException
ModelUpdateException
UnsupportedRDFFormatException
void addRDF(URL url, String baseURI, RDFFormat rdfFormat, ARTResource... graphs) throws FileNotFoundException, IOException, ModelAccessException, ModelUpdateException, UnsupportedRDFFormatException
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.url
- baseURI
- rdfFormat
- if null
, then content format sent must be inferred from the server responsegraphs
- FileNotFoundException
IOException
ModelAccessException
ModelUpdateException
UnsupportedRDFFormatException
void writeRDF(File outputFile, RDFFormat rdfFormat, ARTResource... graphs) throws IOException, ModelAccessException, UnsupportedRDFFormatException
graphs
into file outputFile
. Data in the file
will be formatted according to the specified rdfFormat
.outputFile
- rdfFormat
- graphs
- IOException
ModelAccessException
UnsupportedRDFFormatException
void writeRDF(OutputStream os, RDFFormat rdfFormat, ARTResource... graphs) throws IOException, ModelAccessException, UnsupportedRDFFormatException
graphs
to output stream os
. Data in the file will
be formatted according to the specified rdfFormat
.os
- rdfFormat
- graphs
- IOException
ModelAccessException
UnsupportedRDFFormatException
void close() throws ModelUpdateException
ModelUpdateException
ARTResourceIterator listNamedGraphs() throws ModelAccessException
ARTResourceIterator
over the namedgraphs declared in the global RDF graphModelAccessException
ARTResourceIterator listSubjectsOfPredObjPair(ARTURIResource predicate, ARTNode object, boolean inferred, ARTResource... graphs) throws ModelAccessException
predicate
and
object
predicate
- object
- inferred
- ModelAccessException
ARTNodeIterator listValuesOfSubjPredPair(ARTResource subject, ARTURIResource predicate, boolean inferred, ARTResource... graphs) throws ModelAccessException
subject
and
predicate
subject
- predicate
- inferred
- contexts
- ModelAccessException
ARTURIResourceIterator listPredicatesOfSubjObjPair(ARTResource subject, ARTNode object, boolean inferred, ARTResource... graphs) throws ModelAccessException
subject
and
object
subject
- object
- inferred
- contexts
- ModelAccessException
Copyright © 2015 ART Group, University of Rome, Tor Vergata. All Rights Reserved.