org.openprovenance.elmo
Class RdfOPMFactory

java.lang.Object
  extended by org.openprovenance.model.OPMFactory
      extended by org.openprovenance.elmo.RdfOPMFactory
All Implemented Interfaces:
CommonURIs

public class RdfOPMFactory
extends OPMFactory

The factory class to create OPM entities that can be serialised to rdf. This package relies on Sesame's elmo, which uses a facade object to access the content of the triple store and update it. Each OPM class generated by JAXB is subclassed to get access to the facade for each instance. The factory class offers several kinds of factory methods. - factory methods that are inherited from OPMFactory, created instance of objects with a facade to the triple store. - factory methods that clone opm entities and create new instances with a facade to a triple store - factroy methods that create facade-with instances of OPM classes from the content of a triple store. Note that to ensure that graph structure is preserved between the Java representation and the RDF triple store, an instance of this factory class is stateful! (The original OPMFactory was purely stateless. Note that JAXB beans that have a field that contains a list only offer a getter method for these fields. They can be updated by getting the list and updating it. If bean content are update this way, the RDF facade may not be aware of the update, and may not propagate it to the triple store. Therefore the factory classes (OPMFactory) offers a number of update methods (typically to add new elements to lists). These methods are overridden by RdfOPMFactory to update the triple store.


Field Summary
 
Fields inherited from class org.openprovenance.model.OPMFactory
builder, compactId, dataFactory, of, opmGraphIdPrefix, packageList, roleIdPrefix, usedIdPrefix, wasControlledByIdPrefix, wasDerivedFromIdPrefix, wasGenerateByIdPrefix, wasTriggeredByIdPrefix
 
Fields inherited from interface org.openprovenance.model.CommonURIs
ENCODING_PROPERTY, LABEL_PROPERTY, NEW_ENCODING_PROPERTY, NEW_LABEL_PROPERTY, NEW_PNAME_PROPERTY, NEW_PROFILE_PROPERTY, NEW_TYPE_PROPERTY, NEW_VALUE_PROPERTY, PNAME_PROPERTY, PROFILE_PROPERTY, TYPE_PROPERTY, VALUE_PROPERTY
 
Constructor Summary
RdfOPMFactory(ObjectFactory o)
           
RdfOPMFactory(ObjectFactory o, org.openrdf.elmo.ElmoManager manager)
           
 
Method Summary
 void addAccounts(AnnotationOrEdgeOrNode hasAccounts, List<AccountRef> accounts)
           
 void addAccounts(HasAccounts element, Collection<AccountRef> accounts)
           
 void addAnnotation(Annotable annotable, Annotation ann)
           
 void addAnnotation(Annotable annotable, EmbeddedAnnotation ann)
          Add annotation to an annotable JAXB Bean and its corresponding RDF facade.
 void addAnnotation(Annotable annotable, javax.xml.bind.JAXBElement<? extends EmbeddedAnnotation> ann)
           
 void addAnnotation(Annotable annotable, Label ann)
           
 void addAnnotation(Annotable annotable, Type ann)
           
 void addAnnotation(Annotable annotable, Value ann)
           
 void addNewAnnotations(Annotable res, List<javax.xml.bind.JAXBElement<? extends EmbeddedAnnotation>> anns)
           
 void addProperty(Annotation ann, Property p)
           
 void addProperty(EmbeddedAnnotation ann, Property p)
           
 String autoGenerateId(String prefix)
          By default, no auto generation of Id.
 String autoGenerateId(String prefix, String id)
          Conditional autogeneration of Id.
 Object getFromRegisters(String id)
           
 RdfAccount newAccount(Account a)
           
 RdfAccount newAccount(QName qname)
           
 List<AccountRef> newAccounts(List<AccountRef> accounts)
           
 RdfAgent newAgent(Agent a)
           
 RdfAgent newAgent(QName qname)
           
 RdfAnnotation newAnnotation(Annotation a)
           
 Annotation newAnnotation(Annotation ann)
           
 RdfArtifact newArtifact(Artifact a)
           
 RdfArtifact newArtifact(QName qname)
           
 RdfEmbeddedAnnotation newEmbeddedAnnotation(Annotation a)
           
 OPMGraph newOPMGraph(OPMGraph gr)
           
 RdfOPMGraph newOPMGraph(OPMGraph gr)
          Clones an OPMGraph to an OPMGraph with facade, and creates corresponding rdf representation in triple store.
 OPMGraph newOPMGraph(String id, Collection<Account> accs, Collection<Overlaps> ops, Collection<Process> ps, Collection<Artifact> as, Collection<Agent> ags, Collection<Object> lks, Collection<Annotation> anns)
           
 RdfOTime newOTime(OTime a)
           
 RdfProcess newProcess(Process a)
           
 RdfProcess newProcess(QName qname)
           
 List<Property> newProperties(List<Property> props)
           
 RdfProperty newProperty(Property a)
           
 RdfRole newRole(QName qname)
           
 RdfRole newRole(Role r)
           
 RdfUsed newUsed(Used a)
           
 Used newUsed(Used d)
           
 RdfWasControlledBy newWasControlledBy(WasControlledBy a)
           
 WasControlledBy newWasControlledBy(WasControlledBy d)
           
 RdfWasDerivedFrom newWasDerivedFrom(WasDerivedFrom a)
           
 WasDerivedFrom newWasDerivedFrom(WasDerivedFrom d)
           
 RdfWasGeneratedBy newWasGeneratedBy(WasGeneratedBy a)
           
 WasGeneratedBy newWasGeneratedBy(WasGeneratedBy d)
           
 RdfWasTriggeredBy newWasTriggeredBy(WasTriggeredBy a)
           
 WasTriggeredBy newWasTriggeredBy(WasTriggeredBy d)
           
 void processAnnotations(Annotable a, Annotable res)
           
 RdfAccount register(QName qname, RdfAccount account)
           
 RdfAgent register(QName qname, RdfAgent agent)
           
 RdfArtifact register(QName qname, RdfArtifact artifact)
           
 RdfProcess register(QName qname, RdfProcess process)
           
 Account register(String id, Account account)
           
 Agent register(String id, Agent agent)
           
 Artifact register(String id, Artifact artifact)
           
 Process register(String id, Process process)
           
 
Methods inherited from class org.openprovenance.model.OPMFactory
addAccounts, addAnnotation, addAnnotation, addAnnotation, addAnnotations, addCompactAnnotation, addProperty, addProperty, addValue, compactAnnotation, expandAnnotation, getEncoding, getFactory, getLabel, getLabel, getLabel, getLabels, getObjectFactory, getPackageList, getPname, getPname, getPname, getPnames, getProfile, getProfile, getProfile, getProfiles, getRole, getType, getType, getType, getTypes, getValue, getValue, getValues, newAccount, newAccount, newAccount, newAccountRef, newAccounts, newAgent, newAgent, newAgent, newAgentRef, newAnnotation, newAnnotation, newAnnotation, newAnnotation, newAnnotation, newAnnotation, newAnnotation, newAnnotation, newAnnotation, newAnnotation, newAnnotation, newAnnotationRef, newArtifact, newArtifact, newArtifact, newArtifactRef, newCausalDependencyRef, newCausalDependencyRef, newCausalDependencyRef, newCausalDependencyRef, newCausalDependencyRef, newEmbeddedAnnotation, newEmbeddedAnnotation, newEmbeddedAnnotation, newInstantaneousTime, newInstantaneousTime, newInstantaneousTime, newInstantaneousTimeNow, newLabel, newOPMGraph, newOPMGraph, newOPMGraph, newOPMGraph, newOPMGraph, newOPMGraph, newOPMGraph, newOTime, newOTime, newOTime, newOTime, newOTime, newOTime, newOTime, newOverlaps, newOverlaps, newPName, newProcess, newProcess, newProcess, newProcessRef, newProfile, newProperty, newProperty, newRole, newRole, newRole, newRoleRef, newType, newUsed, newUsed, newUsed, newUsed, newUsedStar, newUsedStar, newValue, newWasControlledBy, newWasControlledBy, newWasControlledBy, newWasControlledBy, newWasControlledBy, newWasDerivedFrom, newWasDerivedFrom, newWasDerivedFrom, newWasDerivedFrom, newWasDerivedFromStar, newWasDerivedFromStar, newWasGeneratedBy, newWasGeneratedBy, newWasGeneratedBy, newWasGeneratedBy, newWasGeneratedByStar, newWasGeneratedByStar, newWasTriggeredBy, newWasTriggeredBy, newWasTriggeredBy, newWasTriggeredBy, newWasTriggeredByStar, newWasTriggeredByStar, newXMLGregorianCalendar, setIdForCompactAnnotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RdfOPMFactory

public RdfOPMFactory(ObjectFactory o)

RdfOPMFactory

public RdfOPMFactory(ObjectFactory o,
                     org.openrdf.elmo.ElmoManager manager)
Method Detail

autoGenerateId

public String autoGenerateId(String prefix)
Description copied from class: OPMFactory
By default, no auto generation of Id. Override this behaviour if required.

Overrides:
autoGenerateId in class OPMFactory

autoGenerateId

public String autoGenerateId(String prefix,
                             String id)
Description copied from class: OPMFactory
Conditional autogeneration of Id. By default, no auto generation of Id. Override this behaviour if required.

Overrides:
autoGenerateId in class OPMFactory

addProperty

public void addProperty(EmbeddedAnnotation ann,
                        Property p)
Overrides:
addProperty in class OPMFactory

addProperty

public void addProperty(Annotation ann,
                        Property p)
Overrides:
addProperty in class OPMFactory

addAccounts

public void addAccounts(HasAccounts element,
                        Collection<AccountRef> accounts)
Overrides:
addAccounts in class OPMFactory

addAnnotation

public void addAnnotation(Annotable annotable,
                          javax.xml.bind.JAXBElement<? extends EmbeddedAnnotation> ann)
Overrides:
addAnnotation in class OPMFactory

addAnnotation

public void addAnnotation(Annotable annotable,
                          Label ann)
Overrides:
addAnnotation in class OPMFactory

addAnnotation

public void addAnnotation(Annotable annotable,
                          Type ann)

addAnnotation

public void addAnnotation(Annotable annotable,
                          Value ann)
Overrides:
addAnnotation in class OPMFactory

addAnnotation

public void addAnnotation(Annotable annotable,
                          Annotation ann)

addAnnotation

public void addAnnotation(Annotable annotable,
                          EmbeddedAnnotation ann)
Add annotation to an annotable JAXB Bean and its corresponding RDF facade.

Overrides:
addAnnotation in class OPMFactory

newOPMGraph

public OPMGraph newOPMGraph(String id,
                            Collection<Account> accs,
                            Collection<Overlaps> ops,
                            Collection<Process> ps,
                            Collection<Artifact> as,
                            Collection<Agent> ags,
                            Collection<Object> lks,
                            Collection<Annotation> anns)
Overrides:
newOPMGraph in class OPMFactory

newArtifact

public RdfArtifact newArtifact(Artifact a)

newArtifact

public RdfArtifact newArtifact(QName qname)

newProcess

public RdfProcess newProcess(Process a)

newProcess

public RdfProcess newProcess(QName qname)

newAgent

public RdfAgent newAgent(Agent a)

newAgent

public RdfAgent newAgent(QName qname)

newAccount

public RdfAccount newAccount(QName qname)

newAccount

public RdfAccount newAccount(Account a)

newRole

public RdfRole newRole(QName qname)

newRole

public RdfRole newRole(Role r)

newProperty

public RdfProperty newProperty(Property a)

newAnnotation

public RdfAnnotation newAnnotation(Annotation a)

newEmbeddedAnnotation

public RdfEmbeddedAnnotation newEmbeddedAnnotation(Annotation a)

register

public RdfAgent register(QName qname,
                         RdfAgent agent)

register

public RdfProcess register(QName qname,
                           RdfProcess process)

register

public RdfArtifact register(QName qname,
                            RdfArtifact artifact)

register

public RdfAccount register(QName qname,
                           RdfAccount account)

register

public Agent register(String id,
                      Agent agent)

register

public Process register(String id,
                        Process process)

register

public Artifact register(String id,
                         Artifact artifact)

register

public Account register(String id,
                        Account account)

newOTime

public RdfOTime newOTime(OTime a)

addAccounts

public void addAccounts(AnnotationOrEdgeOrNode hasAccounts,
                        List<AccountRef> accounts)

newAccounts

public List<AccountRef> newAccounts(List<AccountRef> accounts)

newWasDerivedFrom

public RdfWasDerivedFrom newWasDerivedFrom(WasDerivedFrom a)

newWasGeneratedBy

public RdfWasGeneratedBy newWasGeneratedBy(WasGeneratedBy a)

newUsed

public RdfUsed newUsed(Used a)

newWasControlledBy

public RdfWasControlledBy newWasControlledBy(WasControlledBy a)

newWasTriggeredBy

public RdfWasTriggeredBy newWasTriggeredBy(WasTriggeredBy a)

processAnnotations

public void processAnnotations(Annotable a,
                               Annotable res)

addNewAnnotations

public void addNewAnnotations(Annotable res,
                              List<javax.xml.bind.JAXBElement<? extends EmbeddedAnnotation>> anns)
Overrides:
addNewAnnotations in class OPMFactory

newOPMGraph

public OPMGraph newOPMGraph(OPMGraph gr)

newWasDerivedFrom

public WasDerivedFrom newWasDerivedFrom(WasDerivedFrom d)
Overrides:
newWasDerivedFrom in class OPMFactory

newWasTriggeredBy

public WasTriggeredBy newWasTriggeredBy(WasTriggeredBy d)
Overrides:
newWasTriggeredBy in class OPMFactory

newUsed

public Used newUsed(Used d)
Overrides:
newUsed in class OPMFactory

newWasGeneratedBy

public WasGeneratedBy newWasGeneratedBy(WasGeneratedBy d)
Overrides:
newWasGeneratedBy in class OPMFactory

newWasControlledBy

public WasControlledBy newWasControlledBy(WasControlledBy d)
Overrides:
newWasControlledBy in class OPMFactory

newProperties

public List<Property> newProperties(List<Property> props)

newAnnotation

public Annotation newAnnotation(Annotation ann)
Overrides:
newAnnotation in class OPMFactory

getFromRegisters

public Object getFromRegisters(String id)

newOPMGraph

public RdfOPMGraph newOPMGraph(OPMGraph gr)
Clones an OPMGraph to an OPMGraph with facade, and creates corresponding rdf representation in triple store. This is definitely a stateful operation.

Overrides:
newOPMGraph in class OPMFactory


Copyright © 2010. All Rights Reserved.