public class ChangeFactory extends Object
A new change can be obtained by calling one of the methods
createInsertion(String)
createDeletion(String)
createMove(String)
createUpdate(String)
createPermutationOfEntities(String)
If you do not have any information of the type of change, you can also call
the createChange(String)
method to semantically just say it's a
change..
The annotations can be obtained using getAnnotaions()
(as
Apache/Jena RDF model), getRdfXml()
(encoded in RDF/XML),
printTtl()
(printed to sysout in TURTLE format), or
printXml()
(printed to sysout in RDF/XML format).
Modifier and Type | Field and Description |
---|---|
static String |
COMODI_NS
The namespace of COMODI.
|
static String |
FOAF_NS
The friend-of-a-friend namespace.
|
static String |
ORE_NS
The Open Archives Initiative Object Reuse and Exchange (OAI-ORE) namespace.
|
static String |
PAV_NS
The PAV namespace.
|
static String |
PROV_NS
The PROV namespace.
|
static String |
RDF_NS
The RDF namespace.
|
static String |
RDFS_NS
The RDF schema namespace.
|
Constructor and Description |
---|
ChangeFactory(URI baseUri)
The Constructor specifying the base URI of the file containing the changes.
|
Modifier and Type | Method and Description |
---|---|
Change |
createChange(String subjectId)
Creates a change encoded the subject with
subjectId . |
protected Change |
createChange(String subjectId,
String type)
Creates a new Change object for a subject.
|
Change |
createDeletion(String subjectId)
Creates a deletion encoded the subject with
subjectId . |
Change |
createInsertion(String subjectId)
Creates a insertion encoded the subject with
subjectId . |
Change |
createMove(String subjectId)
Creates a move encoded the subject with
subjectId . |
Change |
createPermutationOfEntities(String subjectId)
Creates a permutation of entities (move) encoded the subject with
subjectId . |
Change |
createUpdate(String subjectId)
Creates a update encoded the subject with
subjectId . |
org.apache.jena.rdf.model.Model |
getAnnotaions()
Gets the annotations.
|
URI |
getBaseUri()
Gets the base URI for entities in this patch.
|
List<Change> |
getChanges()
Gets all registered changes.
|
int |
getNumChanges()
Gets the number changes produced by this factory.
|
int |
getNumStatements()
Gets the number of overall statements in all changes produced by this
change factory.
|
String |
getRdfXml()
Compiles the assembled changes in an RDF/XML string.
|
static String |
getSubjectId(de.unirostock.sems.xmlutils.ds.DocumentNode node)
Gets the subject id of a DocumentNode.
|
static String |
getSubjectId(org.jdom2.Element node)
Gets the subject id of an Element.
|
void |
printTtl()
Prints the TURTLE serialisation to sysout.
|
void |
printXml()
Prints the RDF/XML serialisation to sysout.
|
public static final String RDF_NS
public static final String RDFS_NS
public static final String COMODI_NS
public static final String PROV_NS
public static final String PAV_NS
public static final String FOAF_NS
public static final String ORE_NS
public ChangeFactory(URI baseUri)
baseUri
- the URI of the file containing the changes we'll be talking aboutpublic URI getBaseUri()
public int getNumStatements()
public int getNumChanges()
public Change createChange(String subjectId)
subjectId
.
Calling this method means you have no more information about the type of
that change. Otherwise you should call on of the methods
createInsertion(String)
createDeletion(String)
createMove(String)
createUpdate(String)
createPermutationOfEntities(String)
getSubjectId(Element)
and getSubjectId(DocumentNode)
to conveniently obtain the subjectId of JDOM2 Elements and DocumentNodes.subjectId
- the id of the subject, ie. the changepublic static String getSubjectId(org.jdom2.Element node)
id
attribute value.
That means, this node is supposed to have an id
attribute.node
- the document nodeElement
public static String getSubjectId(de.unirostock.sems.xmlutils.ds.DocumentNode node)
getId()
.
That means, this node is supposed to have an id
attribute.node
- the document nodeDocumentNode
protected Change createChange(String subjectId, String type)
type
subjectId
- the subject idtype
- the typepublic Change createInsertion(String subjectId)
subjectId
.
See getSubjectId(Element)
and getSubjectId(DocumentNode)
to conveniently obtain the subjectId of JDOM2 Elements and DocumentNodes.subjectId
- the id of the subject, ie. the changepublic Change createDeletion(String subjectId)
subjectId
.
See getSubjectId(Element)
and getSubjectId(DocumentNode)
to conveniently obtain the subjectId of JDOM2 Elements and DocumentNodes.subjectId
- the id of the subject, ie. the changepublic Change createUpdate(String subjectId)
subjectId
.
See getSubjectId(Element)
and getSubjectId(DocumentNode)
to conveniently obtain the subjectId of JDOM2 Elements and DocumentNodes.subjectId
- the id of the subject, ie. the changepublic Change createMove(String subjectId)
subjectId
.
See getSubjectId(Element)
and getSubjectId(DocumentNode)
to conveniently obtain the subjectId of JDOM2 Elements and DocumentNodes.subjectId
- the id of the subject, ie. the changepublic Change createPermutationOfEntities(String subjectId)
subjectId
.
See getSubjectId(Element)
and getSubjectId(DocumentNode)
to conveniently obtain the subjectId of JDOM2 Elements and DocumentNodes.subjectId
- the id of the subject, ie. the changepublic String getRdfXml()
public org.apache.jena.rdf.model.Model getAnnotaions()
public void printTtl()
public void printXml()
Copyright © 2017 SEMS project @ University of Rostock. All rights reserved.