java.lang.Object
org.openprovenance.prov.model.ProvFactory
- All Implemented Interfaces:
LiteralConstructor,ModelConstructor,ModelConstructorExtension
- Direct Known Subclasses:
ProvFactory
public abstract class ProvFactory
extends Object
implements LiteralConstructor, ModelConstructor, ModelConstructorExtension
A stateless factory for PROV objects.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(HasOther a, Other o) addAttributes(ActedOnBehalfOf from, ActedOnBehalfOf to) addAttributes(Activity from, Activity to) addAttributes(Agent from, Agent to) addAttributes(Entity from, Entity to) addAttributes(Used from, Used to) addAttributes(WasAssociatedWith from, WasAssociatedWith to) addAttributes(WasAttributedTo from, WasAttributedTo to) addAttributes(WasDerivedFrom from, WasDerivedFrom to) addAttributes(WasEndedBy from, WasEndedBy to) addAttributes(WasGeneratedBy from, WasGeneratedBy to) addAttributes(WasInfluencedBy from, WasInfluencedBy to) addAttributes(WasInformedBy from, WasInformedBy to) addAttributes(WasInvalidatedBy from, WasInvalidatedBy to) addAttributes(WasStartedBy from, WasStartedBy to) voidvoidvoidvoidvoidvoidvoidvoidaddType(HasType a, Object o, QualifiedName type) voidaddType(HasType a, QualifiedName type) voidbyte[]base64Encoding(byte[] b) getAttributes(Statement statement) getName()abstract ProvSerialiserbyte[]hexEncoding(byte[] b) protected voidinit()newActedOnBehalfOf(QualifiedName id, QualifiedName delegate, QualifiedName responsible) A factory method to create an instance of a delegationActedOnBehalfOfnewActedOnBehalfOf(QualifiedName id, QualifiedName delegate, QualifiedName responsible, QualifiedName activity) A factory method to create an instance of a delegationActedOnBehalfOfnewActivity(QualifiedName q, String label) Creates a copy of an agent.Creates a newAgentwith provided identifiernewAgent(QualifiedName ag, String label) Creates a newAgentwith provided identifier and labelnewAttribute(String namespace, String localName, String prefix, Object value, QualifiedName type) abstract AttributenewAttribute(Attribute.AttributeKind kind, Object value, QualifiedName type) abstract AttributenewAttribute(QualifiedName elementName, Object value, QualifiedName type) newDictionaryMembership(QualifiedName dict, List<Entry> entitySet) Factory method to construct aDocumentnewDocument(Collection<Activity> ps, Collection<Entity> as, Collection<Agent> ags, Collection<Statement> lks) newDocument(Activity[] ps, Entity[] as, Agent[] ags, Statement[] lks) newDocument(Document doc) newDuration(int durationInMilliSeconds) newDuration(String lexicalRepresentation) Factory method for a duration.Creates a copy of an entity.Creates a newEntitywith provided identifiernewEntity(QualifiedName id, String label) Creates a newEntitywith provided identifier and labelabstract EntrynewEntry(Key key, QualifiedName entity) Factory method for Key-entity entries.newGDay(int day) Factory method for a gDay.newGMonth(int month) Factory method for a gMonth.newGMonthDay(int month, int day) Factory method for a gMonthDay.newGYear(int year) Factory method for a gYear.abstract HadMembernewHadMember(QualifiedName collection, QualifiedName... entities) abstract LangStringabstract LangStringnewInternationalizedString(String s, String lang) newISOTime(String time) Factory method for a dateTime.newISOTime(String time, TimeZone timeZone) newISOTime(String time, DateTimeOption option, TimeZone optionalTimeZone) newISOTimeTZ(String time) Factory method for a dateTime.newISOTimeUTC(String time) Factory method for a dateTime.abstract KeynewKey(Object o, QualifiedName type) abstract AttributenewLabel(Object value, QualifiedName type) abstract LocationnewLocation(Object value, QualifiedName type) newNamedBundle(QualifiedName id, Collection<Activity> ps, Collection<Entity> as, Collection<Agent> ags, Collection<Statement> lks) newNamedBundle(QualifiedName id, Collection<Statement> statements) abstract BundlenewNamedBundle(QualifiedName id, Namespace namespace, Collection<Statement> statements) A factory method to create an instance of a BundleBundleabstract OthernewOther(QualifiedName elementName, Object value, QualifiedName type) abstract QualifiedNamenewQualifiedName(String namespace, String local, String prefix) A factory method forQualifiedName.abstract QualifiedNamenewQualifiedName(String namespace, String local, String prefix, ProvUtilities.BuildFlag flag) A factory method forQualifiedName.newQualifiedName(QName qname) abstract RolenewRole(Object value, QualifiedName type) <T extends Statement>
TnewStatement(T s) Factory method for this moment's time expressed as dateTime.abstract TypenewType(Object value, QualifiedName type) newUsed(QualifiedName id) A factory method to create an instance of a usageUsednewUsed(QualifiedName activity, QualifiedName entity) A factory method to create an instance of a usageUsednewUsed(QualifiedName id, QualifiedName activity, String role, QualifiedName entity) newUsed(QualifiedName id, QualifiedName activity, QualifiedName entity) A factory method to create an instance of a usageUsednewUsed(QualifiedName id, QualifiedName activity, QualifiedName entity, XMLGregorianCalendar time) A factory method to create an instance of a usageUsedfrom anothernewValue(int value) Factory method to create an instance of the PROV-DM prov:value attribute (seeValue).abstract ValuenewValue(Object value, QualifiedName type) Factory method to create an instance of the PROV-DM prov:value attribute (seeValue).Factory method to create an instance of the PROV-DM prov:value attribute (seeValue).A factory method to create an instance of an AssociationWasAssociatedWithnewWasAssociatedWith(QualifiedName id, QualifiedName activity, QualifiedName agent) A factory method to create an instance of an AssociationWasAssociatedWithnewWasAssociatedWith(QualifiedName id, QualifiedName a, QualifiedName ag, QualifiedName plan) newWasAttributedTo(QualifiedName id, QualifiedName entity, QualifiedName agent) A factory method to create an instance of an attributionWasAttributedToA factory method to create an instance of a derivationWasDerivedFromnewWasDerivedFrom(QualifiedName id, QualifiedName e2, QualifiedName e1) A factory method to create an instance of a derivationWasDerivedFromA factory method to create an instance of an endWasEndedBynewWasEndedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger) A factory method to create an instance of an endWasEndedBynewWasEndedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger, QualifiedName ender) A factory method to create an instance of an endWasEndedBynewWasGeneratedBy(Entity a, String role, Activity p) newWasGeneratedBy(QualifiedName id, Entity a, String role, Activity p) newWasGeneratedBy(QualifiedName id, QualifiedName entity, String role, QualifiedName activity) newWasGeneratedBy(QualifiedName id, QualifiedName entity, QualifiedName activity) A factory method to create an instance of a generationWasGeneratedBynewWasInfluencedBy(QualifiedName id, QualifiedName influencee, QualifiedName influencer) A factory method to create an instance of an influenceWasInfluencedBynewWasInformedBy(QualifiedName id, QualifiedName informed, QualifiedName informant) A factory method to create an instance of an communicationWasInformedBynewWasInvalidatedBy(QualifiedName eid, QualifiedName aid) newWasInvalidatedBy(QualifiedName id, QualifiedName entity, QualifiedName activity) A factory method to create an instance of an invalidationWasInvalidatedByA factory method to create an instance of a startWasStartedBynewWasStartedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger) newWasStartedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger, QualifiedName starter) A factory method to create an instance of a startWasStartedBynewYear(int year) voidsetAttributes(HasOther res, Collection<Attribute> attributes) voidstartBundle(QualifiedName bundleId, Namespace namespaces) voidstartDocument(Namespace namespace) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openprovenance.prov.model.ModelConstructor
newActedOnBehalfOf, newActivity, newAgent, newAlternateOf, newDerivedByInsertionFrom, newDerivedByRemovalFrom, newDictionaryMembership, newDocument, newDocument, newEntity, newMentionOf, newSpecializationOf, newUsed, newWasAssociatedWith, newWasAttributedTo, newWasDerivedFrom, newWasEndedBy, newWasGeneratedBy, newWasInfluencedBy, newWasInformedBy, newWasInvalidatedBy, newWasStartedByMethods inherited from interface org.openprovenance.prov.model.ModelConstructorExtension
newQualifiedAlternateOf, newQualifiedHadMember, newQualifiedSpecializationOf
-
Field Details
-
UTC_TIMEZONE
-
dataFactory
-
-
Constructor Details
-
ProvFactory
public ProvFactory()
-
-
Method Details
-
addAttribute
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addAttributes
-
addLabel
-
addLabel
-
addPrimarySourceType
-
addQuotationType
-
addRevisionType
-
addBundleType
-
addRole
-
addType
-
addType
-
addType
-
base64Decoding
- Specified by:
base64Decodingin interfaceLiteralConstructor
-
base64Encoding
-
getLabel
-
getName
-
getSerializer
-
getRole
-
getType
-
getVersion
-
hexDecoding
- Specified by:
hexDecodingin interfaceLiteralConstructor
-
hexEncoding
-
init
protected void init() -
newActedOnBehalfOf
-
newActedOnBehalfOf
public ActedOnBehalfOf newActedOnBehalfOf(QualifiedName id, QualifiedName delegate, QualifiedName responsible, QualifiedName activity) A factory method to create an instance of a delegationActedOnBehalfOf- Parameters:
id- identifier for the delegation association between delegate and responsibledelegate- identifier for the agent associated with an activity, acting on behalf of the responsible agentresponsible- identifier for the agent, on behalf of which the delegate agent actedactivity- optional identifier of an activity for which the delegation association holds- Returns:
- an instance of
ActedOnBehalfOf
-
newActedOnBehalfOf
public ActedOnBehalfOf newActedOnBehalfOf(QualifiedName id, QualifiedName delegate, QualifiedName responsible) A factory method to create an instance of a delegationActedOnBehalfOf- Parameters:
id- identifier for the delegation association between delegate and responsibledelegate- identifier for the agent associated with an activity, acting on behalf of the responsible agentresponsible- identifier for the agent, on behalf of which the delegate agent acted- Returns:
- an instance of
ActedOnBehalfOf
-
newActivity
-
newActivity
-
newActivity
-
newAgent
-
newAgent
Creates a newAgentwith provided identifier- Parameters:
ag- aQualifiedNamefor the agent- Returns:
- an object of type
Agent
-
newAgent
Creates a newAgentwith provided identifier and label- Parameters:
ag- aQualifiedNamefor the agentlabel- a String for the label property (seeHasLabel.getLabel()- Returns:
- an object of type
Agent
-
newAttribute
-
newAttribute
public abstract Attribute newAttribute(Attribute.AttributeKind kind, Object value, QualifiedName type) -
newAttribute
-
newDictionaryMembership
- Specified by:
newDictionaryMembershipin interfaceModelConstructor
-
newDocument
-
newDocument
-
newDocument
public Document newDocument(Collection<Activity> ps, Collection<Entity> as, Collection<Agent> ags, Collection<Statement> lks) -
newDocument
-
newDuration
-
newDuration
Description copied from interface:LiteralConstructorFactory method for a duration.- Specified by:
newDurationin interfaceLiteralConstructor- Parameters:
lexicalRepresentation-Stringrepresentation of aDuration.- Returns:
- an instance of
Duration
-
newEntity
-
newEntity
Creates a newEntitywith provided identifier- Parameters:
id- aQualifiedNamefor the entity- Returns:
- an object of type
Entity
-
newEntity
Creates a newEntitywith provided identifier and label- Parameters:
id- aQualifiedNamefor the entitylabel- a String for the label property (seeHasLabel.getLabel()- Returns:
- an object of type
Entity
-
newEntry
Factory method for Key-entity entries. Key-entity entries are used to identify the members of a dictionary.- Parameters:
key- indexing the entity in the dictionaryentity- aQualifiedNamedenoting an entity- Returns:
- an instance of
Entry
-
newGDay
Description copied from interface:LiteralConstructorFactory method for a gDay. AgDayrepresents a gregorian day that recurs, specifically a day of the month such as the 5th of the month.- Specified by:
newGDayin interfaceLiteralConstructor- Parameters:
day- value- Returns:
- an instance of
XMLGregorianCalendar
-
newGMonth
Description copied from interface:LiteralConstructorFactory method for a gMonth. AgMonthrepresents a gregorian month that recurs every year.- Specified by:
newGMonthin interfaceLiteralConstructor- Parameters:
month- value- Returns:
- an instance of
XMLGregorianCalendar
-
newGMonthDay
Description copied from interface:LiteralConstructorFactory method for a gMonthDay. AgMonthDayis a gregorian date that recurs, specifically a day of the year such as the third of May.- Specified by:
newGMonthDayin interfaceLiteralConstructor- Parameters:
month- valueday- value- Returns:
- an instance of
XMLGregorianCalendar
-
newGYear
Description copied from interface:LiteralConstructorFactory method for a gYear. AgYearrepresents a gregorian calendar year.- Specified by:
newGYearin interfaceLiteralConstructor- Parameters:
year- value- Returns:
- an instance of
XMLGregorianCalendar
-
newHadMember
-
newHadMember
- Specified by:
newHadMemberin interfaceModelConstructor
-
newInternationalizedString
-
newInternationalizedString
-
newISOTime
Description copied from interface:LiteralConstructorFactory method for a dateTime.- Specified by:
newISOTimein interfaceLiteralConstructor- Parameters:
time- A string containing lexical representation of xsd:datetime.- Returns:
- an instance of
XMLGregorianCalendarexpressed in the system default timezone
-
newISOTimeTZ
Description copied from interface:LiteralConstructorFactory method for a dateTime.- Specified by:
newISOTimeTZin interfaceLiteralConstructor- Parameters:
time- A string containing lexical representation of xsd:datetime.- Returns:
- an instance of
XMLGregorianCalendarnormalized in UTC
-
newISOTimeUTC
Description copied from interface:LiteralConstructorFactory method for a dateTime.- Specified by:
newISOTimeUTCin interfaceLiteralConstructor- Parameters:
time- A string containing lexical representation of xsd:datetime.- Returns:
- an instance of
XMLGregorianCalendar
-
newISOTime
-
newISOTime
public XMLGregorianCalendar newISOTime(String time, DateTimeOption option, TimeZone optionalTimeZone) -
newKey
-
newLabel
-
newLocation
-
newMentionOf
-
newNamedBundle
public Bundle newNamedBundle(QualifiedName id, Collection<Activity> ps, Collection<Entity> as, Collection<Agent> ags, Collection<Statement> lks) -
newNamedBundle
-
newNamedBundle
public abstract Bundle newNamedBundle(QualifiedName id, Namespace namespace, Collection<Statement> statements) Description copied from interface:ModelConstructorA factory method to create an instance of a BundleBundle- Specified by:
newNamedBundlein interfaceModelConstructor- Parameters:
id- an identifier for the bundlenamespace- aNamespaceobject mapping prefix to namespace URIsstatements- a set of provenance descriptions- Returns:
Bundle
-
newOther
-
newOther
-
newQualifiedName
Description copied from interface:ModelConstructorA factory method forQualifiedName. A qualified name consists of a namespace, denoted by an optional prefix, and a local name.- Specified by:
newQualifiedNamein interfaceModelConstructor- Parameters:
namespace- a URI for the namespacelocal- a local nameprefix- a string, which can be null.- Returns:
- an instance of
QualifiedName
-
newQualifiedName
public abstract QualifiedName newQualifiedName(String namespace, String local, String prefix, ProvUtilities.BuildFlag flag) Description copied from interface:ModelConstructorA factory method forQualifiedName. A qualified name consists of a namespace, denoted by an optional prefix, and a local name.- Specified by:
newQualifiedNamein interfaceModelConstructor- Parameters:
namespace- a URI for the namespacelocal- a local nameprefix- a string, which can be nullflag- build flag.- Returns:
- an instance of
QualifiedName
-
newQualifiedName
-
newRole
-
newTime
-
newTime
-
newTimeNow
Description copied from interface:LiteralConstructorFactory method for this moment's time expressed as dateTime.- Specified by:
newTimeNowin interfaceLiteralConstructor- Returns:
- an instance of
XMLGregorianCalendar
-
newType
-
newUsed
-
newUsed
-
newUsed
A factory method to create an instance of a usageUsed -
newUsed
A factory method to create an instance of a usageUsed -
newUsed
public Used newUsed(QualifiedName id, QualifiedName activity, QualifiedName entity, XMLGregorianCalendar time) -
newUsed
-
newValue
Factory method to create an instance of the PROV-DM prov:value attribute (seeValue).- Parameters:
value- a String- Returns:
- a new
Valuewith type xsd:string (seeName.XSD_STRING)
-
newValue
Factory method to create an instance of the PROV-DM prov:value attribute (seeValue).- Parameters:
value- an integer- Returns:
- a new
Valuewith type xsd:int (seeName.XSD_INT)
-
newValue
Factory method to create an instance of the PROV-DM prov:value attribute (seeValue). Use classNamefor predefinedQualifiedNames for the common types.- Parameters:
value- anObjecttype- aQualifiedNameto denote the type of value- Returns:
- a new
Value
-
newWasAssociatedWith
A factory method to create an instance of an AssociationWasAssociatedWith- Parameters:
id- an identifier for the association- Returns:
- an instance of
WasAssociatedWith
-
newWasAssociatedWith
public WasAssociatedWith newWasAssociatedWith(QualifiedName id, QualifiedName activity, QualifiedName agent) A factory method to create an instance of an AssociationWasAssociatedWith- Parameters:
id- an optional identifier for the association between an activity and an agentactivity- an identifier for the activityagent- an optional identifier for the agent associated with the activity- Returns:
- an instance of
WasAssociatedWith
-
newWasAssociatedWith
public WasAssociatedWith newWasAssociatedWith(QualifiedName id, QualifiedName a, QualifiedName ag, QualifiedName plan) -
newWasAssociatedWith
-
newWasAttributedTo
public WasAttributedTo newWasAttributedTo(QualifiedName id, QualifiedName entity, QualifiedName agent) A factory method to create an instance of an attributionWasAttributedTo- Parameters:
id- an optional identifier for the relationentity- an entity identifieragent- the identifier of the agent whom the entity is ascribed to, and therefore bears some responsibility for its existence- Returns:
- an instance of
WasAttributedTo
-
newWasAttributedTo
-
newWasDerivedFrom
A factory method to create an instance of a derivationWasDerivedFrom- Parameters:
id- an optional identifier for a derivatione2- the identifier of the entity generated by the derivatione1- the identifier of the entity used by the derivation- Returns:
- an instance of
WasDerivedFrom
-
newWasDerivedFrom
A factory method to create an instance of a derivationWasDerivedFrom- Parameters:
e2- the identifier of the entity generated by the derivatione1- the identifier of the entity used by the derivation- Returns:
- an instance of
WasDerivedFrom
-
newWasDerivedFrom
-
newWasEndedBy
A factory method to create an instance of an endWasEndedBy- Parameters:
id- an identifier for an end- Returns:
- an instance of
WasEndedBy
-
newWasEndedBy
A factory method to create an instance of an endWasEndedBy- Parameters:
id- an identifier for an endactivity- an identifier for the ended activitytrigger- an optional identifier for the entity triggering the activity ending- Returns:
- an instance of
WasEndedBy
-
newWasEndedBy
public WasEndedBy newWasEndedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger, QualifiedName ender) A factory method to create an instance of an endWasEndedBy- Parameters:
id- optional identifier for an endactivity- an identifier for the ended activitytrigger- an optional identifier for the entity triggering the activity endingender- an optional identifier for the activity that generated the (possibly unspecified) entity- Returns:
- an instance of
WasEndedBy
-
newWasEndedBy
-
newWasGeneratedBy
-
newWasGeneratedBy
-
newWasGeneratedBy
-
newWasGeneratedBy
public WasGeneratedBy newWasGeneratedBy(QualifiedName id, QualifiedName entity, String role, QualifiedName activity) -
newWasGeneratedBy
public WasGeneratedBy newWasGeneratedBy(QualifiedName id, QualifiedName entity, QualifiedName activity) A factory method to create an instance of a generationWasGeneratedBy- Parameters:
id- an optional identifier for a usageentity- an identifier for the created entityactivity- an optional identifier for the activity that creates the entity- Returns:
- an instance of
WasGeneratedBy
-
newWasGeneratedBy
-
getAllAttributes
-
newWasInfluencedBy
public WasInfluencedBy newWasInfluencedBy(QualifiedName id, QualifiedName influencee, QualifiedName influencer) A factory method to create an instance of an influenceWasInfluencedBy- Parameters:
id- optional identifier identifying the associationinfluencee- an identifier for an entity, activity, or agentinfluencer- an identifier for an ancestor entity, activity, or agent that the former depends on- Returns:
- an instance of
WasInfluencedBy
-
newWasInfluencedBy
-
newWasInformedBy
public WasInformedBy newWasInformedBy(QualifiedName id, QualifiedName informed, QualifiedName informant) A factory method to create an instance of an communicationWasInformedBy- Parameters:
id- an optional identifier identifying the association;informed- the identifier of the informed activity;informant- the identifier of the informant activity;- Returns:
- an instance of
WasInformedBy
-
newWasInformedBy
-
newWasInvalidatedBy
-
newWasInvalidatedBy
public WasInvalidatedBy newWasInvalidatedBy(QualifiedName id, QualifiedName entity, QualifiedName activity) A factory method to create an instance of an invalidationWasInvalidatedBy- Parameters:
id- an optional identifier for a usageentity- an identifier for the created entityactivity- an optional identifier for the activity that creates the entity- Returns:
- an instance of
WasInvalidatedBy
-
newWasInvalidatedBy
-
newWasStartedBy
A factory method to create an instance of a startWasStartedBy- Parameters:
id- an identifier for a start- Returns:
- an instance of
WasStartedBy
-
newWasStartedBy
public WasStartedBy newWasStartedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger) -
newWasStartedBy
public WasStartedBy newWasStartedBy(QualifiedName id, QualifiedName activity, QualifiedName trigger, QualifiedName starter) A factory method to create an instance of a startWasStartedBy- Parameters:
id- optional identifier for a startactivity- an identifier for the started activitytrigger- an optional identifier for the entity triggering the activitystarter- an optional identifier for the activity that generated the (possibly unspecified) entity- Returns:
- an instance of
WasStartedBy
-
newWasStartedBy
-
newXMLGregorianCalendar
-
newYear
-
getAttributes
-
setAttributes
-
startBundle
- Specified by:
startBundlein interfaceModelConstructor
-
startDocument
- Specified by:
startDocumentin interfaceModelConstructor
-
newNamespace
-
newNamespace
-
newAlternateOf
-
newSpecializationOf
-
newHadMember
-
newStatement
-