Class RdfCollector
- java.lang.Object
-
- org.openrdf.rio.helpers.AbstractRDFHandler
-
- org.openrdf.rio.helpers.RDFHandlerBase
-
- org.openprovenance.prov.rdf.collector.RdfCollector
-
- All Implemented Interfaces:
org.openrdf.rio.RDFHandler
- Direct Known Subclasses:
QualifiedCollector
public class RdfCollector extends org.openrdf.rio.helpers.RDFHandlerBase
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringBNODE_NSprotected HashMap<QualifiedName,HashMap<QualifiedName,List<org.openrdf.model.Statement>>>collatorsprotected Documentdocumentprotected Namenameprotected Ontologyontoprotected ProvFactorypFactoryprotected Typestypes
-
Constructor Summary
Constructors Constructor Description RdfCollector(ProvFactory pFactory, Ontology onto)
-
Method Summary
Modifier and Type Method Description protected QualifiedNamebnodeToQualifiedName(org.openrdf.model.BNode bnode)protected QualifiedNamebnodeToQualifiedName(org.openrdf.model.impl.SimpleBNode bnode)protected voidbuildBundles()protected voidbuildGraph()List<Attribute>collectAttributes(QualifiedName context, QualifiedName qualifiedName, Types.ProvType type)protected QualifiedNameconvertResourceToQualifiedName(org.openrdf.model.Resource resource)protected QualifiedNameconvertURIToQualifiedName(org.openrdf.model.URI uri)protected List<Entry>createKeyEntityPairs(QualifiedName context, List<QualifiedName> pairs)protected ObjectdecodeLiteral(org.openrdf.model.Literal literal)QualifiedNameemptyQualifiedName()voidendRDF()protected List<org.openrdf.model.Value>getDataObjects(QualifiedName context, QualifiedName subject, QualifiedName pred)DocumentgetDocument()protected Types.ProvType[]getExplicitTypes(QualifiedName context, QualifiedName qualifiedName)protected List<QualifiedName>getObjects(QualifiedName context, QualifiedName subject, QualifiedName pred)protected org.openrdf.model.StatementgetSingleStatementForPredicate(QualifiedName context, QualifiedName qualifiedName, QualifiedName uri)protected List<org.openrdf.model.Statement>getStatementsForPredicate(QualifiedName context, QualifiedName qualifiedName, QualifiedName uri)voidhandleNamespace(String prefix, String namespace)RDFHandlerBase overridesvoidhandleStatement(org.openrdf.model.Statement statement)protected booleanisBNodeReferenced(org.openrdf.model.BNode object)AttributenewAttribute(org.openrdf.model.Literal lit, QualifiedName type)AttributenewAttributeForValue(org.openrdf.model.Value obj, QualifiedName type)protected voidstore(QualifiedName context, Relation relation0)protected KeyvalueToKey(org.openrdf.model.Value value)protected ObjectvalueToObject(org.openrdf.model.Value value)
-
-
-
Field Detail
-
pFactory
protected final ProvFactory pFactory
-
name
protected final Name name
-
collators
protected HashMap<QualifiedName,HashMap<QualifiedName,List<org.openrdf.model.Statement>>> collators
-
document
protected Document document
-
onto
protected final Ontology onto
-
BNODE_NS
protected static String BNODE_NS
-
types
protected final Types types
-
-
Constructor Detail
-
RdfCollector
public RdfCollector(ProvFactory pFactory, Ontology onto)
-
-
Method Detail
-
store
protected void store(QualifiedName context, Relation relation0)
-
isBNodeReferenced
protected boolean isBNodeReferenced(org.openrdf.model.BNode object)
-
getStatementsForPredicate
protected List<org.openrdf.model.Statement> getStatementsForPredicate(QualifiedName context, QualifiedName qualifiedName, QualifiedName uri)
-
getSingleStatementForPredicate
protected org.openrdf.model.Statement getSingleStatementForPredicate(QualifiedName context, QualifiedName qualifiedName, QualifiedName uri)
-
getExplicitTypes
protected Types.ProvType[] getExplicitTypes(QualifiedName context, QualifiedName qualifiedName)
-
convertResourceToQualifiedName
protected QualifiedName convertResourceToQualifiedName(org.openrdf.model.Resource resource)
-
valueToObject
protected Object valueToObject(org.openrdf.model.Value value)
-
valueToKey
protected Key valueToKey(org.openrdf.model.Value value)
-
decodeLiteral
protected Object decodeLiteral(org.openrdf.model.Literal literal)
-
buildGraph
protected void buildGraph()
-
buildBundles
protected void buildBundles()
-
emptyQualifiedName
public QualifiedName emptyQualifiedName()
-
convertURIToQualifiedName
protected QualifiedName convertURIToQualifiedName(org.openrdf.model.URI uri)
-
collectAttributes
public List<Attribute> collectAttributes(QualifiedName context, QualifiedName qualifiedName, Types.ProvType type)
-
newAttributeForValue
public Attribute newAttributeForValue(org.openrdf.model.Value obj, QualifiedName type)
-
newAttribute
public Attribute newAttribute(org.openrdf.model.Literal lit, QualifiedName type)
-
getDataObjects
protected List<org.openrdf.model.Value> getDataObjects(QualifiedName context, QualifiedName subject, QualifiedName pred)
-
createKeyEntityPairs
protected List<Entry> createKeyEntityPairs(QualifiedName context, List<QualifiedName> pairs)
-
getObjects
protected List<QualifiedName> getObjects(QualifiedName context, QualifiedName subject, QualifiedName pred)
-
getDocument
public Document getDocument()
-
handleNamespace
public void handleNamespace(String prefix, String namespace)
RDFHandlerBase overrides- Specified by:
handleNamespacein interfaceorg.openrdf.rio.RDFHandler- Overrides:
handleNamespacein classorg.openrdf.rio.helpers.AbstractRDFHandler
-
bnodeToQualifiedName
protected QualifiedName bnodeToQualifiedName(org.openrdf.model.BNode bnode)
-
bnodeToQualifiedName
protected QualifiedName bnodeToQualifiedName(org.openrdf.model.impl.SimpleBNode bnode)
-
handleStatement
public void handleStatement(org.openrdf.model.Statement statement)
- Specified by:
handleStatementin interfaceorg.openrdf.rio.RDFHandler- Overrides:
handleStatementin classorg.openrdf.rio.helpers.AbstractRDFHandler
-
endRDF
public void endRDF()
- Specified by:
endRDFin interfaceorg.openrdf.rio.RDFHandler- Overrides:
endRDFin classorg.openrdf.rio.helpers.AbstractRDFHandler
-
-