Class AbstractRdfConverter

java.lang.Object
org.wikidata.wdtk.rdf.AbstractRdfConverter
Direct Known Subclasses:
RdfConverter

public abstract class AbstractRdfConverter extends Object
This class provides functions to convert objects of wdtk-datamodel in a rdf graph.
Author:
Michael Günther
  • Constructor Details

  • Method Details

    • writeBasicDeclarations

      public void writeBasicDeclarations() throws org.eclipse.rdf4j.rio.RDFHandlerException
      Writes OWL declarations for all basic vocabulary elements used in the dump. Example of the triples written by this method: wikibase:propertyType rdf:type owl:ObjectProperty
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writeNamespaceDeclarations

      public void writeNamespaceDeclarations() throws org.eclipse.rdf4j.rio.RDFHandlerException
      Writes all namespace declarations used in the dump, for example wikibase: or schema:.
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • finishDocument

      public void finishDocument() throws org.eclipse.rdf4j.rio.RDFHandlerException
      Writes all buffered triples and finishes writing a document. This will take care of writing auxiliary triples that got buffered during serialization, such as OWL declarations, references and auxiliary triples for complex values.
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writeOWLDeclarations

      public void writeOWLDeclarations()
    • writeDocumentType

      public void writeDocumentType(org.eclipse.rdf4j.model.Resource subject, org.eclipse.rdf4j.model.IRI type)
    • writeItemDocument

      public void writeItemDocument(ItemDocument document) throws org.eclipse.rdf4j.rio.RDFHandlerException
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writePropertyDatatype

      public void writePropertyDatatype(PropertyDocument document)
    • writePropertyDocument

      public void writePropertyDocument(PropertyDocument document) throws org.eclipse.rdf4j.rio.RDFHandlerException
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writeInterPropertyLinks

      public void writeInterPropertyLinks(PropertyDocument document) throws org.eclipse.rdf4j.rio.RDFHandlerException
      Writes triples which connect properties with their corresponding rdf properties for statements, simple statements, qualifiers, reference attributes and values.
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writeDocumentTerms

      public void writeDocumentTerms(TermedDocument document) throws org.eclipse.rdf4j.rio.RDFHandlerException
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writeTermTriples

      public void writeTermTriples(org.eclipse.rdf4j.model.Resource subject, AbstractRdfConverter.TermKind kind, Collection<MonolingualTextValue> terms) throws org.eclipse.rdf4j.rio.RDFHandlerException
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writeStatements

      public void writeStatements(StatementDocument statementDocument) throws org.eclipse.rdf4j.rio.RDFHandlerException
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writeStatement

      public void writeStatement(Statement statement, boolean best) throws org.eclipse.rdf4j.rio.RDFHandlerException
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writeFullStatement

      public void writeFullStatement(Statement statement, boolean best) throws org.eclipse.rdf4j.rio.RDFHandlerException
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writeSimpleStatement

      public void writeSimpleStatement(Statement statement)
    • writeStatementRankTriple

      public void writeStatementRankTriple(org.eclipse.rdf4j.model.Resource subject, StatementRank rank, boolean best)
      Writes a triple for the StatementRank of a Statement to the dump. If this is a best-rank statement, also writes a best rank triple.
      Parameters:
      subject - The IRI of the statement
      rank - The rank of the statement
      best - True if this statement is a best-rank statement
    • writeReferences

      public void writeReferences(org.eclipse.rdf4j.model.Resource statementResource, List<? extends Reference> references) throws org.eclipse.rdf4j.rio.RDFHandlerException
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • writeClaim

      public void writeClaim(org.eclipse.rdf4j.model.Resource claimResource, Claim claim)
    • writeSiteLinks

      public void writeSiteLinks(org.eclipse.rdf4j.model.Resource subject, Map<String,SiteLink> siteLinks) throws org.eclipse.rdf4j.rio.RDFHandlerException
      Throws:
      org.eclipse.rdf4j.rio.RDFHandlerException
    • getMonolingualTextValueLiteral

      public static org.eclipse.rdf4j.model.Value getMonolingualTextValueLiteral(MonolingualTextValue value, RdfWriter rdfWriter)
    • getDatatypeIri

      public static String getDatatypeIri(DatatypeIdValue datatype)