edu.stanford.smi.protegex.owl.model.triplestore
Class TripleStoreUtil

java.lang.Object
  extended byedu.stanford.smi.protegex.owl.model.triplestore.TripleStoreUtil

public class TripleStoreUtil
extends Object

Author:
Holger Knublauch

Constructor Summary
TripleStoreUtil()
           
 
Method Summary
static void addToTripleStore(OWLModel owlModel, TripleStore tripleStore, RDFResource subject, RDFProperty predicate, Object object)
           
static TripleStore ensureActiveTripleStore(RDFResource resource)
           
private static void getDependingTriples(RDFResource subject, List result)
           
static RDFResource getFirstOntology(OWLModel owlModel, TripleStore tripleStore)
           
static TripleStore getTripleStoreOf(RDFResource subject, edu.stanford.smi.protege.model.Slot slot, Object object)
           
static Iterator listDependingTriples(RDFResource subject)
          Gets all Triples that are contained "within" a resource definition block.
private static void moveResource(edu.stanford.smi.protege.model.Instance instance, Collection slots, edu.stanford.smi.protege.model.framestore.NarrowFrameStore sourceFS, edu.stanford.smi.protege.model.framestore.NarrowFrameStore targetFS)
           
static void moveResources(Collection resources, TripleStore sourceTS, TripleStore targetTS)
           
static void replaceTriple(Triple oldTriple, Triple newTriple)
           
static void runInHomeTripleStoreOf(RDFResource resource, Runnable runnable)
           
static void runInTripleStore(OWLModel owlModel, TripleStore ts, Runnable runnable)
           
static void sortSlotValues(edu.stanford.smi.protege.model.framestore.NarrowFrameStore narrowFrameStore, edu.stanford.smi.protege.model.Instance instance, edu.stanford.smi.protege.model.Slot slot, Comparator comparator)
           
static void sortSubclasses(OWLModel owlModel)
           
static void switchTripleStore(OWLModel owlModel, TripleStore tripleStore)
           
static void updateFrameInclusion(edu.stanford.smi.protege.model.framestore.MergingNarrowFrameStore mnfs, edu.stanford.smi.protege.model.Slot nameSlot)
          Updates the "isIncluded()" flag for all Frames, so that only those Frames that have their :NAME in the active FrameStore are not included.
private static void updateFrameInclusion(edu.stanford.smi.protege.model.framestore.NarrowFrameStore frameStore, edu.stanford.smi.protege.model.Slot nameSlot, boolean included)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TripleStoreUtil

public TripleStoreUtil()
Method Detail

addToTripleStore

public static void addToTripleStore(OWLModel owlModel,
                                    TripleStore tripleStore,
                                    RDFResource subject,
                                    RDFProperty predicate,
                                    Object object)

ensureActiveTripleStore

public static TripleStore ensureActiveTripleStore(RDFResource resource)

getFirstOntology

public static RDFResource getFirstOntology(OWLModel owlModel,
                                           TripleStore tripleStore)

getTripleStoreOf

public static TripleStore getTripleStoreOf(RDFResource subject,
                                           edu.stanford.smi.protege.model.Slot slot,
                                           Object object)

listDependingTriples

public static Iterator listDependingTriples(RDFResource subject)
Gets all Triples that are contained "within" a resource definition block. This includes all property values, recursively into nested anonymous classes and RDFLists. The traversal stops at named resources.

Parameters:
subject - the class to start with
Returns:
an Iterator of Triple objects

getDependingTriples

private static void getDependingTriples(RDFResource subject,
                                        List result)

moveResources

public static void moveResources(Collection resources,
                                 TripleStore sourceTS,
                                 TripleStore targetTS)

moveResource

private static void moveResource(edu.stanford.smi.protege.model.Instance instance,
                                 Collection slots,
                                 edu.stanford.smi.protege.model.framestore.NarrowFrameStore sourceFS,
                                 edu.stanford.smi.protege.model.framestore.NarrowFrameStore targetFS)

replaceTriple

public static void replaceTriple(Triple oldTriple,
                                 Triple newTriple)

runInHomeTripleStoreOf

public static void runInHomeTripleStoreOf(RDFResource resource,
                                          Runnable runnable)

runInTripleStore

public static void runInTripleStore(OWLModel owlModel,
                                    TripleStore ts,
                                    Runnable runnable)

sortSlotValues

public static void sortSlotValues(edu.stanford.smi.protege.model.framestore.NarrowFrameStore narrowFrameStore,
                                  edu.stanford.smi.protege.model.Instance instance,
                                  edu.stanford.smi.protege.model.Slot slot,
                                  Comparator comparator)

sortSubclasses

public static void sortSubclasses(OWLModel owlModel)

switchTripleStore

public static void switchTripleStore(OWLModel owlModel,
                                     TripleStore tripleStore)

updateFrameInclusion

public static void updateFrameInclusion(edu.stanford.smi.protege.model.framestore.MergingNarrowFrameStore mnfs,
                                        edu.stanford.smi.protege.model.Slot nameSlot)
Updates the "isIncluded()" flag for all Frames, so that only those Frames that have their :NAME in the active FrameStore are not included.

Parameters:
mnfs - the MergingNarrowFrameStore

updateFrameInclusion

private static void updateFrameInclusion(edu.stanford.smi.protege.model.framestore.NarrowFrameStore frameStore,
                                         edu.stanford.smi.protege.model.Slot nameSlot,
                                         boolean included)