Package org.wikidata.wdtk.rdf
Class OwlDeclarationBuffer
java.lang.Object
org.wikidata.wdtk.rdf.OwlDeclarationBuffer
This class stores information about data that should be serialized in RDF
later on. This is done for two reasons: (1) to produce output where triples
are ordered by subject, (2) to avoid some duplicate triples for things that
are needed in many places. Due to memory constraints, this class does not
provide perfect duplicate elimination.
- Author:
- Markus Kroetzsch
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClass
(EntityIdValue entityIdValue) Adds the given entity id value to the list of entities that should be declared as OWL classes.void
addDatatypeProperty
(org.eclipse.rdf4j.model.IRI propertyUri) Adds the given property URI string to the list of property URIs that should be declared as OWL datatype properties.void
addDatatypeProperty
(PropertyIdValue propertyIdValue) Adds the given property id value to the list of properties that should be declared as OWL datatype properties.void
addObjectProperty
(org.eclipse.rdf4j.model.IRI propertyUri) Adds the given property URI string to the list of property URIs that should be declared as OWL object properties.void
addObjectProperty
(PropertyIdValue propertyIdValue) Adds the given property id value to the list of properties that should be declared as OWL object properties.void
writePropertyDeclarations
(RdfWriter rdfWriter, boolean fullStatements, boolean simpleClaims) Writes OWL declarations for properties that have been added recently.
-
Constructor Details
-
OwlDeclarationBuffer
public OwlDeclarationBuffer()
-
-
Method Details
-
addObjectProperty
Adds the given property id value to the list of properties that should be declared as OWL object properties.- Parameters:
propertyIdValue
- the property to declare
-
addObjectProperty
public void addObjectProperty(org.eclipse.rdf4j.model.IRI propertyUri) Adds the given property URI string to the list of property URIs that should be declared as OWL object properties.- Parameters:
propertyUri
- the property to declare
-
addDatatypeProperty
Adds the given property id value to the list of properties that should be declared as OWL datatype properties.- Parameters:
propertyIdValue
- the property to declare
-
addDatatypeProperty
public void addDatatypeProperty(org.eclipse.rdf4j.model.IRI propertyUri) Adds the given property URI string to the list of property URIs that should be declared as OWL datatype properties.- Parameters:
propertyUri
- the property to declare
-
addClass
Adds the given entity id value to the list of entities that should be declared as OWL classes.- Parameters:
entityIdValue
- the property to declare
-
writePropertyDeclarations
public void writePropertyDeclarations(RdfWriter rdfWriter, boolean fullStatements, boolean simpleClaims) throws org.eclipse.rdf4j.rio.RDFHandlerException Writes OWL declarations for properties that have been added recently. Declared properties are stored so that duplicate declarations are avoided.- Parameters:
rdfWriter
- the writer to write the declarations tofullStatements
- if true, then properties need to export full statements (with qualifiers and references) will be declaredsimpleClaims
- if true, then properties to export simple claims (flat triples) will be declared- Throws:
org.eclipse.rdf4j.rio.RDFHandlerException
- if there was a problem writing the declarations
-