org.wikidata.wdtk.datamodel.interfaces.SnakVisitor<java.lang.Void>public class SnakRdfConverter
extends java.lang.Object
implements org.wikidata.wdtk.datamodel.interfaces.SnakVisitor<java.lang.Void>
writeSnak(Snak, Resource, PropertyContext). Alternatively, one
can use setSnakContext(Resource, PropertyContext) and use the class
as a visitor. SomeValueSnak and NoValueSnak require further
RDF triples to be written; the same is true for some complex data values that
might be used with ValueSnak. In such cases, the class stores the
values to a buffer. Methods for writing additional triples for these buffered
values can be called later.| Constructor | Description |
|---|---|
SnakRdfConverter(RdfWriter rdfWriter,
OwlDeclarationBuffer owlDeclarationBuffer,
PropertyRegister propertyRegister,
AnyValueConverter valueRdfConverter) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
setSnakContext(org.openrdf.model.Resource subject,
PropertyContext propertyContext) |
Sets the context in which snaks should be used.
|
java.lang.Void |
visit(org.wikidata.wdtk.datamodel.interfaces.NoValueSnak snak) |
|
java.lang.Void |
visit(org.wikidata.wdtk.datamodel.interfaces.SomeValueSnak snak) |
|
java.lang.Void |
visit(org.wikidata.wdtk.datamodel.interfaces.ValueSnak snak) |
|
void |
writeAuxiliaryTriples() |
Writes all auxiliary triples that have been buffered recently.
|
void |
writeSnak(org.wikidata.wdtk.datamodel.interfaces.Snak snak,
org.openrdf.model.Resource subject,
PropertyContext propertyContext) |
Writes the given snak for the given subject.
|
public SnakRdfConverter(RdfWriter rdfWriter, OwlDeclarationBuffer owlDeclarationBuffer, PropertyRegister propertyRegister, AnyValueConverter valueRdfConverter)
public void writeSnak(org.wikidata.wdtk.datamodel.interfaces.Snak snak,
org.openrdf.model.Resource subject,
PropertyContext propertyContext)
writeAuxiliaryTriples() needs to be called to serialize this
additional data later on.snak - the snake to writesubject - the resource that should be used as a subject of the serialied
triplespropertyContext - the context in which the snak is usedpublic void setSnakContext(org.openrdf.model.Resource subject,
PropertyContext propertyContext)
SnakVisitor.subject - the resource that should be used as a subject of the serialied
triplespropertyContext - the context in which the snaks that are to be converted are
usedpublic java.lang.Void visit(org.wikidata.wdtk.datamodel.interfaces.ValueSnak snak)
visit in interface org.wikidata.wdtk.datamodel.interfaces.SnakVisitor<java.lang.Void>public java.lang.Void visit(org.wikidata.wdtk.datamodel.interfaces.SomeValueSnak snak)
visit in interface org.wikidata.wdtk.datamodel.interfaces.SnakVisitor<java.lang.Void>public java.lang.Void visit(org.wikidata.wdtk.datamodel.interfaces.NoValueSnak snak)
visit in interface org.wikidata.wdtk.datamodel.interfaces.SnakVisitor<java.lang.Void>public void writeAuxiliaryTriples()
throws org.openrdf.rio.RDFHandlerException
org.openrdf.rio.RDFHandlerException - if there was a problem writing the RDF triplesCopyright © 2014–2017 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage