Class OwlDeclarationBuffer

java.lang.Object
org.wikidata.wdtk.rdf.OwlDeclarationBuffer

public class OwlDeclarationBuffer extends Object
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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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
    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
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OwlDeclarationBuffer

      public OwlDeclarationBuffer()
  • Method Details

    • addObjectProperty

      public void addObjectProperty(PropertyIdValue propertyIdValue)
      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

      public void addDatatypeProperty(PropertyIdValue propertyIdValue)
      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

      public void addClass(EntityIdValue entityIdValue)
      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 to
      fullStatements - if true, then properties need to export full statements (with qualifiers and references) will be declared
      simpleClaims - 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