Package n10s
Class RDFToLPGStatementProcessor
java.lang.Object
n10s.ConfiguredStatementHandler
n10s.RDFToLPGStatementProcessor
- All Implemented Interfaces:
org.eclipse.rdf4j.rio.RDFHandler
- Direct Known Subclasses:
DirectStatementDeleter,DirectStatementLoader,OntologyImporter,RDFQuadDirectStatementDeleter,RDFQuadDirectStatementLoader,SkosImporter,StatementPreviewer
Created by jbarrasa on 15/04/2019.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classprotected classNested classes/interfaces inherited from class n10s.ConfiguredStatementHandler
ConfiguredStatementHandler.TripleLimitReached -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected booleanprotected org.neo4j.graphdb.GraphDatabaseServicestatic final intprotected StringBuilderprotected final org.neo4j.logging.Loglongprotected NsPrefixMapprotected final RDFParserConfigstatic final intstatic final intprotected Set<org.eclipse.rdf4j.model.Statement>longlongprotected org.neo4j.graphdb.Transactionprotected final org.eclipse.rdf4j.model.ValueFactory -
Constructor Summary
ConstructorsConstructorDescriptionRDFToLPGStatementProcessor(org.neo4j.graphdb.GraphDatabaseService db, org.neo4j.graphdb.Transaction tx, RDFParserConfig conf, org.neo4j.logging.Log l) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddRelProp(org.eclipse.rdf4j.model.Statement stmt, org.eclipse.rdf4j.model.IRI predicate, org.eclipse.rdf4j.model.Literal propValueRaw) protected voidaddStatement(org.eclipse.rdf4j.model.Statement st) protected ObjectgetObjectValue(org.eclipse.rdf4j.model.IRI propertyIRI, org.eclipse.rdf4j.model.Literal object) Processing for literals as follows Mapping according to this figure: https://www.w3.org/TR/xmlschema11-2/#built-in-datatypes String -> String Each sub-category of integer -> long decimal, float, and double -> double boolean -> boolean Custom data type -> String (value + CUSTOM_DATA_TYPE_SEPERATOR + custom DT IRI)protected StringgetValueWithDatatype(org.eclipse.rdf4j.model.IRI datatype, String value) voidhandleComment(String comment) protected StringhandleIRI(org.eclipse.rdf4j.model.IRI iri, int elementType) voidhandleNamespace(String prefix, String uri) voidhandleStatement(org.eclipse.rdf4j.model.Statement st) protected abstract voidprotected voidprotected booleansetProp(String subjectUri, org.eclipse.rdf4j.model.IRI propertyIRI, org.eclipse.rdf4j.model.Literal propValueRaw) voidstartRDF()protected ObjecttoPropertyValue(Object value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.rdf4j.rio.RDFHandler
endRDF
-
Field Details
-
RELATIONSHIP
public static final int RELATIONSHIP- See Also:
-
LABEL
public static final int LABEL- See Also:
-
PROPERTY
public static final int PROPERTY- See Also:
-
DATATYPE
public static final int DATATYPE- See Also:
-
log
protected final org.neo4j.logging.Log log -
tx
protected org.neo4j.graphdb.Transaction tx -
parserConfig
-
graphdb
protected org.neo4j.graphdb.GraphDatabaseService graphdb -
namespaces
-
statements
-
resourceProps
-
relProps
-
resourceLabels
-
totalTriplesParsed
public long totalTriplesParsed -
totalTriplesMapped
public long totalTriplesMapped -
mappedTripleCounter
public long mappedTripleCounter -
vf
protected final org.eclipse.rdf4j.model.ValueFactory vf -
loadWarnings
-
datatypeConflictFound
protected boolean datatypeConflictFound
-
-
Constructor Details
-
RDFToLPGStatementProcessor
public RDFToLPGStatementProcessor(org.neo4j.graphdb.GraphDatabaseService db, org.neo4j.graphdb.Transaction tx, RDFParserConfig conf, org.neo4j.logging.Log l)
-
-
Method Details
-
getObjectValue
protected Object getObjectValue(org.eclipse.rdf4j.model.IRI propertyIRI, org.eclipse.rdf4j.model.Literal object) Processing for literals as follows Mapping according to this figure: https://www.w3.org/TR/xmlschema11-2/#built-in-datatypes String -> String Each sub-category of integer -> long decimal, float, and double -> double boolean -> boolean Custom data type -> String (value + CUSTOM_DATA_TYPE_SEPERATOR + custom DT IRI)- Returns:
- processed literal
-
getValueWithDatatype
-
handleComment
- Throws:
org.eclipse.rdf4j.rio.RDFHandlerException
-
handleIRI
-
startRDF
public void startRDF() throws org.eclipse.rdf4j.rio.RDFHandlerException- Throws:
org.eclipse.rdf4j.rio.RDFHandlerException
-
handleNamespace
public void handleNamespace(String prefix, String uri) throws org.eclipse.rdf4j.rio.RDFHandlerException - Throws:
org.eclipse.rdf4j.rio.RDFHandlerException
-
addStatement
protected void addStatement(org.eclipse.rdf4j.model.Statement st) -
setProp
protected boolean setProp(String subjectUri, org.eclipse.rdf4j.model.IRI propertyIRI, org.eclipse.rdf4j.model.Literal propValueRaw) -
setLabel
-
handleStatement
public void handleStatement(org.eclipse.rdf4j.model.Statement st) -
addRelProp
protected boolean addRelProp(org.eclipse.rdf4j.model.Statement stmt, org.eclipse.rdf4j.model.IRI predicate, org.eclipse.rdf4j.model.Literal propValueRaw) -
getParserConfig
- Specified by:
getParserConfigin classConfiguredStatementHandler
-
getNamespaces
-
toPropertyValue
-
defaultToString
-
periodicOperation
protected abstract void periodicOperation() -
getWarnings
-