it.uniroma2.art.owlart.models
Interface RDFModel

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

public interface RDFModel
extends BaseRDFTripleModel

Interface for basic RDF models
Also, contains extensions to the TripleQueryModel which allows for more flexible management of query parameters

Author:
Armando Stellato

Method Summary
 void addInstance(java.lang.String uri, ARTResource cls, ARTResource... graphs)
          adds a resource with uri=uri to the specified graphs
The resource is automatically typized with class cls
 void addProperty(java.lang.String propertyURI, ARTURIResource superProperty, ARTResource... graphs)
          adds a resource with uri=propertyURI as an rdf:Property
The new property is defined as subproperty of suprtProperty (unless this last is null)
 void addType(ARTResource res, ARTResource cls, ARTResource... graphs)
          adds a type to resource res
 boolean hasType(ARTResource res, ARTResource type, boolean inferred, ARTResource... graphs)
          checks if resource type is a type for resource res
 void instantiatePropertyWithPlainLiteral(ARTResource subject, ARTURIResource predicate, java.lang.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, java.lang.String value, java.lang.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, java.lang.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 isProperty(ARTResource prop, ARTResource... graphs)
          checks that resource prop is a property
If available, reasoning is activated by default, so all kind of properties should be properly checked by this method
 ARTResourceIterator listInstances(ARTResource type, boolean inferred, ARTResource... graphs)
          retrieves all instances of class type
 ARTURIResourceIterator listNamedInstances(ARTResource... graphs)
           
 ARTURIResourceIterator listProperties(ARTResource... graphs)
          list all properties declared in graphs graphs
If available, reasoning is activated by default, so all kind of properties should be returned by this method
 ARTResourceIterator listTypes(ARTResource res, boolean inferred, ARTResource... graphs)
          retrieves all classes which are types for resource res
 void removeType(ARTResource res, ARTResource cls, ARTResource... graphs)
          removes the rdf:type relationship between res and cls
 void renameIndividual(ARTURIResource res, java.lang.String newURI)
          renames a resource (which can either be a class or an individual)
 void renameProperty(ARTURIResource res, java.lang.String newLocalName)
          renames a property
 ARTBNode retrieveBNode(java.lang.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(java.lang.String uri, ARTResource... graphs)
          Contract for this method is:
If there exist a triple in the specified graphs graphs where a resource with uri= uri is mentioned, then return that resource, otherwise return null
 
Methods inherited from interface it.uniroma2.art.owlart.models.BaseRDFTripleModel
addRDF, addRDF, addStatement, addTriple, clearRDF, close, deleteStatement, deleteTriple, getBaseURI, getDefaultNamespace, hasStatement, hasTriple, listNamedGraphs, listNamespaces, listPredicatesOfSubjObjPair, listStatements, listSubjectsOfPredObjPair, listValuesOfSubjPredPair, setBaseURI, setDefaultNamespace, writeRDF, writeRDF
 
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

addInstance

void addInstance(java.lang.String uri,
                 ARTResource cls,
                 ARTResource... graphs)
                 throws ModelUpdateException
adds a resource with uri=uri to the specified graphs
The resource is automatically typized with class cls

Parameters:
uri -
cls -
graphs -
Throws:
ModelUpdateException

addProperty

void addProperty(java.lang.String propertyURI,
                 ARTURIResource superProperty,
                 ARTResource... graphs)
                 throws ModelUpdateException
adds a resource with uri=propertyURI as an rdf:Property
The new property is defined as subproperty of suprtProperty (unless this last is null)

Parameters:
propertyURI -
superProperty -
graphs -
Throws:
ModelUpdateException

addType

void addType(ARTResource res,
             ARTResource cls,
             ARTResource... graphs)
             throws ModelUpdateException
adds a type to resource res

Parameters:
res -
cls -
graphs -
Throws:
ModelUpdateException

instantiatePropertyWithPlainLiteral

void instantiatePropertyWithPlainLiteral(ARTResource subject,
                                         ARTURIResource predicate,
                                         java.lang.String value,
                                         ARTResource... graphs)
                                         throws ModelUpdateException
creates a triple for the given subject, predicate and value
by using a plain literal with no language tag as the object

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

instantiatePropertyWithPlainLiteral

void instantiatePropertyWithPlainLiteral(ARTResource subject,
                                         ARTURIResource predicate,
                                         java.lang.String value,
                                         java.lang.String lang,
                                         ARTResource... graphs)
                                         throws ModelUpdateException
creates a triple for the given subject, predicate and value
by using a plain literal with a language tag as the object

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

instantiatePropertyWithTypedLiteral

void instantiatePropertyWithTypedLiteral(ARTResource subject,
                                         ARTURIResource property,
                                         java.lang.String value,
                                         ARTURIResource datatype,
                                         ARTResource... graphs)
                                         throws ModelUpdateException
creates a triple for the given subject, predicate and object, which is described by its label (value) and (datatype)

Parameters:
subject -
property -
value -
lang -
Throws:
ModelUpdateException

instantiatePropertyWithResource

void instantiatePropertyWithResource(ARTResource subject,
                                     ARTURIResource predicate,
                                     ARTResource object,
                                     ARTResource... graphs)
                                     throws ModelUpdateException
creates a triple for the given subject, predicate and object
just a mere rewriting of addTriple with the object constrained to be a Resource

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

listProperties

ARTURIResourceIterator listProperties(ARTResource... graphs)
                                      throws ModelAccessException
list all properties declared in graphs graphs
If available, reasoning is activated by default, so all kind of properties should be returned by this method

Parameters:
graphs -
Returns:
Throws:
ModelAccessException

retrieveURIResource

ARTURIResource retrieveURIResource(java.lang.String uri,
                                   ARTResource... graphs)
                                   throws ModelAccessException
Contract for this method is:
If there exist a triple in the specified graphs graphs where a resource with uri= uri is mentioned, then return that resource, otherwise return null

Parameters:
uri -
graphs -
Returns:
Throws:
ModelAccessException

retrieveBNode

ARTBNode retrieveBNode(java.lang.String ID,
                       ARTResource... graphs)
                       throws ModelAccessException
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

Parameters:
uri -
graphs -
Returns:
Throws:
ModelAccessException

listTypes

ARTResourceIterator listTypes(ARTResource res,
                              boolean inferred,
                              ARTResource... graphs)
                              throws ModelAccessException
retrieves all classes which are types for resource res

Parameters:
res -
inferred -
graphs -
Returns:
Throws:
ModelAccessException

listInstances

ARTResourceIterator listInstances(ARTResource type,
                                  boolean inferred,
                                  ARTResource... graphs)
                                  throws ModelAccessException
retrieves all instances of class type

Parameters:
type -
inferred -
graphs -
Returns:
Throws:
ModelAccessException

listNamedInstances

ARTURIResourceIterator listNamedInstances(ARTResource... graphs)
                                          throws ModelAccessException
Throws:
ModelAccessException

hasType

boolean hasType(ARTResource res,
                ARTResource type,
                boolean inferred,
                ARTResource... graphs)
                throws ModelAccessException
checks if resource type is a type for resource res

Parameters:
res -
type -
inferred -
graphs -
Returns:
Throws:
ModelAccessException

removeType

void removeType(ARTResource res,
                ARTResource cls,
                ARTResource... graphs)
                throws ModelUpdateException
removes the rdf:type relationship between res and cls

Parameters:
res -
cls -
graphs -
Throws:
ModelUpdateException

renameIndividual

void renameIndividual(ARTURIResource res,
                      java.lang.String newURI)
                      throws ModelUpdateException
renames a resource (which can either be a class or an individual)

Parameters:
res -
newURI -
Throws:
ModelUpdateException

renameProperty

void renameProperty(ARTURIResource res,
                    java.lang.String newLocalName)
                    throws ModelUpdateException
renames a property

Parameters:
res -
newLocalName -
Throws:
ModelUpdateException

isProperty

boolean isProperty(ARTResource prop,
                   ARTResource... graphs)
                   throws ModelAccessException
checks that resource prop is a property
If available, reasoning is activated by default, so all kind of properties should be properly checked by this method

Parameters:
prop -
graphs -
Returns:
Throws:
ModelAccessException


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