|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.uniroma2.art.owlart.models.impl.BaseRDFModelImpl
it.uniroma2.art.owlart.models.impl.SPARQLBasedRDFTripleModelImpl
public class SPARQLBasedRDFTripleModelImpl
| Nested Class Summary | |
|---|---|
class |
SPARQLBasedRDFTripleModelImpl.StatementAfterTupleBindings
wraps a TupleBindings object the content of which is composed of a |
class |
SPARQLBasedRDFTripleModelImpl.StatementIteratorAfterTupleBindingsIterator
wraps a TupleBindingsIterator the content of which is composed of |
| Field Summary |
|---|
| Fields inherited from class it.uniroma2.art.owlart.models.impl.BaseRDFModelImpl |
|---|
baseRep |
| Constructor Summary | |
|---|---|
SPARQLBasedRDFTripleModelImpl(TripleQueryModelHTTPConnection tqModel)
|
|
| 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 |
ARTBNode |
createBNode()
this method just generates a POJO wrapping a blank node for the ontology. |
ARTBNode |
createBNode(java.lang.String ID)
this method just generates a POJO wrapping a blank node for the ontology. |
BooleanQuery |
createBooleanQuery(QueryLanguage ql,
java.lang.String query,
java.lang.String baseURI)
creates a boolean query. |
GraphQuery |
createGraphQuery(QueryLanguage ql,
java.lang.String query,
java.lang.String baseURI)
creates a graph query. |
ARTLiteral |
createLiteral(java.lang.String literalString)
creates a literal from its string representation |
ARTLiteral |
createLiteral(java.lang.String literalString,
ARTURIResource datatype)
composes an creates a literal with a given datatype |
ARTLiteral |
createLiteral(java.lang.String literalString,
java.lang.String language)
composes and creates a literal starting from its base label and the assigned language |
Query |
createQuery(QueryLanguage ql,
java.lang.String query,
java.lang.String baseURI)
creates a generic query. |
TupleQuery |
createTupleQuery(QueryLanguage ql,
java.lang.String query,
java.lang.String baseURI)
creates a tuple query. |
ARTURIResource |
createURIResource(java.lang.String uri)
this method just generates a POJO wrapping an URI for the ontology. |
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 |
expandQName(java.lang.String qname)
Expand a qname into an uri using the prefix mappings, if a prefix is available The contract for this method requests that also a valid URI is acceptable as the argument, and in case this is returned as it is |
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 |
java.util.Map<java.lang.String,java.lang.String> |
getNamespacePrefixMapping()
Return a copy of the internal mapping from prefixes to namespaces (as strings). |
java.lang.String |
getNSForPrefix(java.lang.String prefix)
Gets the URI bound to a specific prefix, null if there isn't one. |
java.lang.String |
getPrefixForNS(java.lang.String namespace)
Answer the prefix for the given URI, or null if there isn't one. |
java.lang.String |
getQName(java.lang.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 |
ARTResourceIterator |
listNamedGraphs()
returns an ARTResourceIterator over the namedgraphs declared in the global RDF graph |
ARTNamespaceIterator |
listNamespaces()
list all namespaces used in this model |
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. |
void |
removeNsPrefixMapping(java.lang.String namespace)
Removes prefix/namespace mapping |
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 |
setNsPrefix(java.lang.String namespace,
java.lang.String prefix)
Specify the prefix name for a URI prefix string. |
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 class it.uniroma2.art.owlart.models.impl.BaseRDFModelImpl |
|---|
listPredicatesOfSubjObjPair, listSubjectsOfPredObjPair, listValuesOfSubjPredPair |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface it.uniroma2.art.owlart.models.BaseRDFTripleModel |
|---|
listPredicatesOfSubjObjPair, listSubjectsOfPredObjPair, listValuesOfSubjPredPair |
| Constructor Detail |
|---|
public SPARQLBasedRDFTripleModelImpl(TripleQueryModelHTTPConnection tqModel)
| Method Detail |
|---|
public Query createQuery(QueryLanguage ql,
java.lang.String query,
java.lang.String baseURI)
throws UnsupportedQueryLanguageException,
ModelAccessException,
MalformedQueryException
TripleQueryModelquery)
createQuery in interface TripleQueryModelql - the query languagequery - the text content of the querybaseURI - the baseuri to be considered for relative resources' names in the given query
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public BooleanQuery createBooleanQuery(QueryLanguage ql,
java.lang.String query,
java.lang.String baseURI)
throws UnsupportedQueryLanguageException,
ModelAccessException,
MalformedQueryException
TripleQueryModel
createBooleanQuery in interface TripleQueryModelql - the query languagequery - the text content of the querybaseURI - the baseuri to be considered for relative resources' names in the given query
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public GraphQuery createGraphQuery(QueryLanguage ql,
java.lang.String query,
java.lang.String baseURI)
throws UnsupportedQueryLanguageException,
ModelAccessException,
MalformedQueryException
TripleQueryModel
createGraphQuery in interface TripleQueryModelql - the query languagequery - the text content of the querybaseURI - the baseuri to be considered for relative resources' names in the given query
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public TupleQuery createTupleQuery(QueryLanguage ql,
java.lang.String query,
java.lang.String baseURI)
throws UnsupportedQueryLanguageException,
ModelAccessException,
MalformedQueryException
TripleQueryModel
createTupleQuery in interface TripleQueryModelql - the query languagequery - the text content of the querybaseURI - the baseuri to be considered for relative resources' names in the given query
UnsupportedQueryLanguageException
ModelAccessException
MalformedQueryException
public void addTriple(ARTResource subject,
ARTURIResource predicate,
ARTNode object,
ARTResource... graphs)
throws ModelUpdateException
BaseRDFTripleModelgraphs
addTriple in interface BaseRDFTripleModelModelUpdateException
public void addStatement(ARTStatement stat,
ARTResource... graphs)
throws ModelUpdateException
BaseRDFTripleModelstat to graphs graphs
addStatement in interface BaseRDFTripleModelModelUpdateException
public void deleteTriple(ARTResource subject,
ARTURIResource property,
ARTNode object,
ARTResource... graphs)
throws ModelUpdateException
BaseRDFTripleModelsubject, property, object
> from the specified graphs
deleteTriple in interface BaseRDFTripleModelModelUpdateException
public void deleteStatement(ARTStatement statement,
ARTResource... graphs)
throws ModelUpdateException
BaseRDFTripleModelgraphs
deleteStatement in interface BaseRDFTripleModelModelUpdateException
public void clearRDF(ARTResource... graphs)
throws ModelUpdateException
BaseRDFTripleModel
clearRDF in interface BaseRDFTripleModelModelUpdateException
public void addRDF(java.io.File inputFile,
java.lang.String baseURI,
RDFFormat rdfFormat,
ARTResource... graphs)
throws java.io.FileNotFoundException,
java.io.IOException,
ModelAccessException,
ModelUpdateException,
UnsupportedRDFFormatException
BaseRDFTripleModelgraphs 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 BaseRDFTripleModeljava.io.FileNotFoundException
java.io.IOException
ModelAccessException
ModelUpdateException
UnsupportedRDFFormatException
public void addRDF(java.net.URL url,
java.lang.String baseURI,
RDFFormat rdfFormat,
ARTResource... graphs)
throws java.io.FileNotFoundException,
java.io.IOException,
ModelAccessException,
ModelUpdateException,
UnsupportedRDFFormatException
BaseRDFTripleModelgraphs 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 BaseRDFTripleModeljava.io.FileNotFoundException
java.io.IOException
ModelAccessException
ModelUpdateException
UnsupportedRDFFormatException
public void writeRDF(java.io.File outputFile,
RDFFormat rdfFormat,
ARTResource... graphs)
throws java.io.IOException,
ModelAccessException,
UnsupportedRDFFormatException
BaseRDFTripleModelgraphs into file outputFile. Data in the file
will be formatted according to the specified rdfFormat.
writeRDF in interface BaseRDFTripleModeljava.io.IOException
ModelAccessException
UnsupportedRDFFormatException
public void writeRDF(java.io.OutputStream os,
RDFFormat rdfFormat,
ARTResource... graphs)
throws java.io.IOException,
ModelAccessException,
UnsupportedRDFFormatException
BaseRDFTripleModelgraphs to output stream os. Data in the file will
be formatted according to the specified rdfFormat.
writeRDF in interface BaseRDFTripleModeljava.io.IOException
ModelAccessException
UnsupportedRDFFormatException
public ARTNamespaceIterator listNamespaces()
throws ModelAccessException
BaseRDFTripleModel
listNamespaces in interface BaseRDFTripleModelModelAccessException
public ARTResourceIterator listNamedGraphs()
throws ModelAccessException
BaseRDFTripleModelARTResourceIterator over the namedgraphs declared in the global RDF graph
listNamedGraphs in interface BaseRDFTripleModelModelAccessException
public boolean hasTriple(ARTResource subj,
ARTURIResource pred,
ARTNode obj,
boolean inferred,
ARTResource... graphs)
throws ModelAccessException
BaseRDFTripleModelsubj, pred, obj> is
present in this model, inside one of the graphs specified in graphs
hasTriple in interface BaseRDFTripleModelsubj - 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 triple
ModelAccessException
public boolean hasStatement(ARTStatement stat,
boolean inferred,
ARTResource... graphs)
throws ModelAccessException
BaseRDFTripleModelgraphs
hasStatement in interface BaseRDFTripleModelstat - 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 statement
ModelAccessException
public ARTStatementIterator listStatements(ARTResource subj,
ARTURIResource pred,
ARTNode obj,
boolean inferred,
ARTResource... graphs)
throws ModelAccessException
BaseRDFTripleModelsubj, 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 BaseRDFTripleModelsubj - the subject of the triplepred - the predicate of the tripleobj - the object of the triple
ModelAccessException
public void close()
throws ModelUpdateException
BaseRDFTripleModel
close in interface BaseRDFTripleModelModelUpdateException
public void setDefaultNamespace(java.lang.String namespace)
throws ModelUpdateException
BaseRDFTripleModel
setDefaultNamespace in interface BaseRDFTripleModelModelUpdateException
public void setBaseURI(java.lang.String uri)
throws ModelUpdateException
BaseRDFTripleModel
setBaseURI in interface BaseRDFTripleModelModelUpdateExceptionpublic java.lang.String getDefaultNamespace()
BaseRDFTripleModel
getDefaultNamespace in interface BaseRDFTripleModelpublic java.lang.String getBaseURI()
BaseRDFTripleModel
getBaseURI in interface BaseRDFTripleModelpublic ARTLiteral createLiteral(java.lang.String literalString)
ARTNodeFactory
createLiteral in interface ARTNodeFactory
public ARTLiteral createLiteral(java.lang.String literalString,
java.lang.String language)
ARTNodeFactory
createLiteral in interface ARTNodeFactory
public ARTLiteral createLiteral(java.lang.String literalString,
ARTURIResource datatype)
ARTNodeFactory
createLiteral in interface ARTNodeFactorypublic ARTURIResource createURIResource(java.lang.String uri)
ARTNodeFactory
createURIResource in interface ARTNodeFactorypublic ARTBNode createBNode()
ARTNodeFactory
createBNode in interface ARTNodeFactorypublic ARTBNode createBNode(java.lang.String ID)
ARTNodeFactory
createBNode in interface ARTNodeFactoryID - an internal identifier which can be used to retrieve the blank node, if known
public java.lang.String expandQName(java.lang.String qname)
throws ModelAccessException
PrefixMapping
expandQName in interface PrefixMappingModelAccessException
public java.lang.String getQName(java.lang.String uri)
throws ModelAccessException
PrefixMapping
getQName in interface PrefixMappingModelAccessException
public java.util.Map<java.lang.String,java.lang.String> getNamespacePrefixMapping()
throws ModelAccessException
PrefixMapping
getNamespacePrefixMapping in interface PrefixMappingModelAccessException
public java.lang.String getNSForPrefix(java.lang.String prefix)
throws ModelAccessException
PrefixMapping
getNSForPrefix in interface PrefixMappingModelAccessException
public java.lang.String getPrefixForNS(java.lang.String namespace)
throws ModelAccessException
PrefixMapping
getPrefixForNS in interface PrefixMappingModelAccessException
public void setNsPrefix(java.lang.String namespace,
java.lang.String prefix)
throws ModelUpdateException
PrefixMapping
setNsPrefix in interface PrefixMappingModelUpdateException
public void removeNsPrefixMapping(java.lang.String namespace)
throws ModelUpdateException
PrefixMapping
removeNsPrefixMapping in interface PrefixMappingModelUpdateException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||