edu.stanford.smi.protegex.owl.model.triplestore
Interface TripleStore

All Superinterfaces:
NamespaceMap
All Known Implementing Classes:
AbstractTripleStore

public interface TripleStore
extends NamespaceMap

An interface for low-level access to the single triples in an OWLModel. All current implementations are better suited for querying than actually writing triples, so better don't modify the triples in your own application yet. If you need to do that, make sure that you invoke the post-processor as done in the ProtegeOWLParser.

Author:
Holger Knublauch

Method Summary
 void add(RDFResource subject, RDFProperty predicate, Object object)
           
 void add(Triple triple)
           
 boolean contains(RDFResource subject, RDFProperty predicate, Object object)
           
 boolean contains(Triple triple)
           
 void dump()
          Debugging only.
 RDFResource getHomeResource(String name)
           
 String getName()
           
 edu.stanford.smi.protege.model.framestore.NarrowFrameStore getNarrowFrameStore()
          Provides access to the internal Protege storage for low-level access.
 Iterator listHomeResources()
          Gets all resources that have their "home" in this triple store.
 Iterator listObjects(RDFResource subject, RDFProperty property)
          Gets the values of a given subject/property combination.
 Iterator listSubjects(RDFProperty property)
          The the subjects of all triples where a given property has any value.
 Iterator listSubjects(RDFProperty predicate, Object object)
          Gets the subjects of all triples with a given predicate and object.
 Iterator listTriples()
           
 Iterator listTriplesWithObject(RDFObject object)
          Lists all Triples that have a given object.
 Iterator listTriplesWithSubject(RDFResource subject)
          Lists all Triples that have a given subject.
 void remove(RDFResource subject, RDFProperty predicate, Object object)
           
 void remove(Triple triple)
           
 void setName(String value)
           
 void setRDFResourceName(RDFResource resource, String name)
           
 void sortPropertyValues(RDFResource resource, RDFProperty property, Comparator comparator)
           
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.NamespaceMap
getDefaultNamespace, getNamespaceForPrefix, getPrefix, getPrefixes, removePrefix, setDefaultNamespace, setDefaultNamespace, setPrefix, setPrefix
 

Method Detail

add

public void add(Triple triple)

add

public void add(RDFResource subject,
                RDFProperty predicate,
                Object object)

contains

public boolean contains(Triple triple)

contains

public boolean contains(RDFResource subject,
                        RDFProperty predicate,
                        Object object)

getName

public String getName()

getHomeResource

public RDFResource getHomeResource(String name)

getNarrowFrameStore

public edu.stanford.smi.protege.model.framestore.NarrowFrameStore getNarrowFrameStore()
Provides access to the internal Protege storage for low-level access. This method should only be used by experienced users.

Returns:
the NarrowFrameStore

listHomeResources

public Iterator listHomeResources()
Gets all resources that have their "home" in this triple store. The home is defined to be the TripleStore with the :NAME value of the resource.

Returns:
an Iterator of RDFResources

listObjects

public Iterator listObjects(RDFResource subject,
                            RDFProperty property)
Gets the values of a given subject/property combination.

Parameters:
subject -
property -
Returns:
a Collection of Objects (e.g. RDFResources)

listSubjects

public Iterator listSubjects(RDFProperty property)
The the subjects of all triples where a given property has any value. The Iterator does not contain duplicates.

Parameters:
property - the property to look for
Returns:
an Iterator of RDFResources

listSubjects

public Iterator listSubjects(RDFProperty predicate,
                             Object object)
Gets the subjects of all triples with a given predicate and object.

Parameters:
predicate - the predicate to match
object - the object to match
Returns:
an Iterator of RDFResources

listTriples

public Iterator listTriples()

listTriplesWithObject

public Iterator listTriplesWithObject(RDFObject object)
Lists all Triples that have a given object.

Parameters:
object - the object to get the triples of
Returns:
an Iterator of Triples

listTriplesWithSubject

public Iterator listTriplesWithSubject(RDFResource subject)
Lists all Triples that have a given subject. In other words, this returns all property-value pairs of a given resource. Note that this operation is currently not efficiently implemented.

Parameters:
subject - the subject in the triples
Returns:
an Iterator of Triples

remove

public void remove(Triple triple)

remove

public void remove(RDFResource subject,
                   RDFProperty predicate,
                   Object object)

setName

public void setName(String value)

setRDFResourceName

public void setRDFResourceName(RDFResource resource,
                               String name)

sortPropertyValues

public void sortPropertyValues(RDFResource resource,
                               RDFProperty property,
                               Comparator comparator)

dump

public void dump()
Debugging only.