it.uniroma2.art.owlart.models
Interface BaseRDFTripleModel

All Superinterfaces:
ARTNodeFactory, PrefixMapping, TripleQueryModel
All Known Subinterfaces:
DirectReasoning, OWLModel, RDFModel, RDFSModel, SKOSModel, SKOSXLModel, TransactionBasedModel
All Known Implementing Classes:
BaseRDFModelImpl, OWLModelImpl, RDFModelImpl, RDFSModelImpl, SKOSModelImpl, SKOSXLModelImpl, SPARQLBasedRDFTripleModelImpl

public interface BaseRDFTripleModel
extends PrefixMapping, TripleQueryModel, ARTNodeFactory

Model containing basic RDF management methods. This is the sole model which does not contain a default implementation in this library, and is thus a container for those methods which must be implemented for any wrapped RDF management technology This model supports Named Graphs, so wrapper RDF technologies must also support named graphs or be provided with some extension for supporting them.

SEMANTICS FOR NAMED GRAPHS IN THESE API

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.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

Author:
Armando Stellato

Method Summary
 void addRDF(java.io.File inputFile, java.lang.String baseURI, RDFFormat rdfFormat, ARTResource... graphs)
          adds RDF data to graphs graphs by loading it from inputfile inputFile.
 void addRDF(java.net.URL url, java.lang.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
 java.lang.String getBaseURI()
          returns the baseuri of the ontology managed by this model
 java.lang.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(java.lang.String uri)
          sets the baseuri for the ontology managed by this model
 void setDefaultNamespace(java.lang.String namespace)
          sets the default namespace for the ontology managed by this model
 void writeRDF(java.io.File outputFile, RDFFormat rdfFormat, ARTResource... graphs)
          writes RDF data from graphs graphs into file outputFile.
 void writeRDF(java.io.OutputStream os, RDFFormat rdfFormat, ARTResource... graphs)
          writes RDF data from graphs graphs to output stream os.
 
Methods inherited from interface it.uniroma2.art.owlart.models.PrefixMapping
expandQName, getNamespacePrefixMapping, getNSForPrefix, getPrefixForNS, getQName, removeNsPrefixMapping, setNsPrefix
 
Methods inherited from interface it.uniroma2.art.owlart.models.TripleQueryModel
createBooleanQuery, createGraphQuery, createQuery, createTupleQuery
 
Methods inherited from interface it.uniroma2.art.owlart.model.ARTNodeFactory
createBNode, createBNode, createLiteral, createLiteral, createLiteral, createURIResource
 

Method Detail

addTriple

void addTriple(ARTResource subject,
               ARTURIResource predicate,
               ARTNode object,
               ARTResource... graphs)
               throws ModelUpdateException
adds the specified triple to graphs graphs

Parameters:
subject -
predicate -
object -
graphs -
Throws:
ModelUpdateException

addStatement

void addStatement(ARTStatement stat,
                  ARTResource... graphs)
                  throws ModelUpdateException
add statement stat to graphs graphs

Parameters:
stat -
graphs -
Throws:
ModelUpdateException

setDefaultNamespace

void setDefaultNamespace(java.lang.String namespace)
                         throws ModelUpdateException
sets the default namespace for the ontology managed by this model

Parameters:
namespace -
Throws:
ModelUpdateException

setBaseURI

void setBaseURI(java.lang.String uri)
                throws ModelUpdateException
sets the baseuri for the ontology managed by this model

Parameters:
uri -
Throws:
ModelUpdateException

getDefaultNamespace

java.lang.String getDefaultNamespace()
returns the default namespace of the ontology managed by this model

Returns:

getBaseURI

java.lang.String getBaseURI()
returns the baseuri of the ontology managed by this model

Returns:

hasTriple

boolean hasTriple(ARTResource subj,
                  ARTURIResource pred,
                  ARTNode obj,
                  boolean inferred,
                  ARTResource... graphs)
                  throws ModelAccessException
checks that the triple identified by <subj, pred, obj> is present in this model, inside one of the graphs specified in graphs

Parameters:
subj - the subject of the triple
pred - the predicate of the triple
obj - the object of the triple
inferred - tells if the inference engine of the model is to be used for this retrieval operation
graphs - the graphs where to look for the specified triple
Returns:
true or false according to the presence of the triple in the model
Throws:
ModelAccessException

hasStatement

boolean hasStatement(ARTStatement stat,
                     boolean inferred,
                     ARTResource... graphs)
                     throws ModelAccessException
checks that the specified statement is present in this model, inside one of the graphs specified in graphs

Parameters:
stat - the statement which is checked inside the model
inferred - tells if the inference engine of the model is to be used for this retrieval operation
graphs - the graphs where to look for the specified statement
Returns:
Throws:
ModelAccessException

listStatements

ARTStatementIterator listStatements(ARTResource subj,
                                    ARTURIResource pred,
                                    ARTNode obj,
                                    boolean inferred,
                                    ARTResource... graphs)
                                    throws ModelAccessException
returns statements which unify with triples containing 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.

Parameters:
subj - the subject of the triple
pred - the predicate of the triple
obj - the object of the triple
Returns:
an STStatementIterator over statements in the loaded set of ontologies
Throws:
ModelAccessException

deleteTriple

void deleteTriple(ARTResource subject,
                  ARTURIResource property,
                  ARTNode object,
                  ARTResource... graphs)
                  throws ModelUpdateException
deletes the triple identified by <subject, property, object > from the specified graphs

Parameters:
subject -
property -
object -
graphs -
Throws:
ModelUpdateException

deleteStatement

void deleteStatement(ARTStatement statement,
                     ARTResource... graphs)
                     throws ModelUpdateException
deletes the specified statement from graphs graphs

Parameters:
statement -
graphs -
Throws:
ModelUpdateException

clearRDF

void clearRDF(ARTResource... graphs)
              throws ModelUpdateException
completely clears any RDF statement from the specified graphs

Throws:
ModelUpdateException

listNamespaces

ARTNamespaceIterator listNamespaces()
                                    throws ModelAccessException
list all namespaces used in this model

Returns:
Throws:
ModelAccessException

addRDF

void addRDF(java.io.File inputFile,
            java.lang.String baseURI,
            RDFFormat rdfFormat,
            ARTResource... graphs)
            throws java.io.FileNotFoundException,
                   java.io.IOException,
                   ModelAccessException,
                   ModelUpdateException,
                   UnsupportedRDFFormatException
adds RDF data to graphs 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.

Parameters:
inputFile -
baseURI -
rdfFormat -
graphs -
Throws:
java.io.FileNotFoundException
java.io.IOException
ModelAccessException
ModelUpdateException
UnsupportedRDFFormatException

addRDF

void addRDF(java.net.URL url,
            java.lang.String baseURI,
            RDFFormat rdfFormat,
            ARTResource... graphs)
            throws java.io.FileNotFoundException,
                   java.io.IOException,
                   ModelAccessException,
                   ModelUpdateException,
                   UnsupportedRDFFormatException
adds RDF data to graphs 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.
Implementation of this method are expected to use content negotiation to negotiate RDF data with the server, asking MIME type for the appropriate rdf serialization format (MIME type can be obtained through RDFFormat.getMIMEType() method.

Parameters:
url -
baseURI -
rdfFormat -
graphs -
Throws:
java.io.FileNotFoundException
java.io.IOException
ModelAccessException
ModelUpdateException
UnsupportedRDFFormatException

writeRDF

void writeRDF(java.io.File outputFile,
              RDFFormat rdfFormat,
              ARTResource... graphs)
              throws java.io.IOException,
                     ModelAccessException,
                     UnsupportedRDFFormatException
writes RDF data from graphs graphs into file outputFile. Data in the file will be formatted according to the specified rdfFormat.

Parameters:
outputFile -
rdfFormat -
graphs -
Throws:
java.io.IOException
ModelAccessException
UnsupportedRDFFormatException

writeRDF

void writeRDF(java.io.OutputStream os,
              RDFFormat rdfFormat,
              ARTResource... graphs)
              throws java.io.IOException,
                     ModelAccessException,
                     UnsupportedRDFFormatException
writes RDF data from graphs graphs to output stream os. Data in the file will be formatted according to the specified rdfFormat.

Parameters:
os -
rdfFormat -
graphs -
Throws:
java.io.IOException
ModelAccessException
UnsupportedRDFFormatException

close

void close()
           throws ModelUpdateException
closes the current model, releasing its resources

Throws:
ModelUpdateException

listNamedGraphs

ARTResourceIterator listNamedGraphs()
                                    throws ModelAccessException
returns an ARTResourceIterator over the namedgraphs declared in the global RDF graph

Returns:
Throws:
ModelAccessException

listSubjectsOfPredObjPair

ARTResourceIterator listSubjectsOfPredObjPair(ARTURIResource predicate,
                                              ARTNode object,
                                              boolean inferred,
                                              ARTResource... graphs)
                                              throws ModelAccessException
list all resources which appear as subjects of statements having given predicate and object

Parameters:
predicate -
object -
inferred -
Returns:
Throws:
ModelAccessException

listValuesOfSubjPredPair

ARTNodeIterator listValuesOfSubjPredPair(ARTResource subject,
                                         ARTURIResource predicate,
                                         boolean inferred,
                                         ARTResource... graphs)
                                         throws ModelAccessException
list all nodes which appear as objects of statements having given subject and predicate

Parameters:
subject -
predicate -
inferred -
contexts -
Returns:
Throws:
ModelAccessException

listPredicatesOfSubjObjPair

ARTURIResourceIterator listPredicatesOfSubjObjPair(ARTResource subject,
                                                   ARTNode object,
                                                   boolean inferred,
                                                   ARTResource... graphs)
                                                   throws ModelAccessException
list all uri resources which appear as predicates of statements having given subject and object

Parameters:
subject -
object -
inferred -
contexts -
Returns:
Throws:
ModelAccessException


Copyright © 2011 ART Group, University of Rome, Tor Vergata. All Rights Reserved.