Package org.incenp.obofoundry.sssom.rdf
Class RDFWriter
- java.lang.Object
-
- org.incenp.obofoundry.sssom.SSSOMWriter
-
- org.incenp.obofoundry.sssom.rdf.RDFWriter
-
public class RDFWriter extends SSSOMWriter
A writer to serialise a SSSOM mapping set into the RDF Turtle format.
-
-
Field Summary
-
Fields inherited from class org.incenp.obofoundry.sssom.SSSOMWriter
condensationPolicy, extensionManager, extraPolicy, prefixManager, targetVersion
-
-
Constructor Summary
Constructors Constructor Description RDFWriter(File file)Creates a new instance that will write data to the specified file.RDFWriter(OutputStream stream)Creates a new instance that will write data to the specified stream.RDFWriter(String filename)Creates a new instance that will write data to a file with the specified filename.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoWrite(MappingSet mappingSet)Actually serialises a mapping set.voidsetInjectDirectTriples(boolean withDirectTriples)Configures the writer to inject “direct triples” or not.-
Methods inherited from class org.incenp.obofoundry.sssom.SSSOMWriter
condenseSet, getUsedPrefixes, getUsedPrefixes, setCondensationEnabled, setCurieMap, setExtraMetadataPolicy, setSortingEnabled, setTargetVersion, write
-
-
-
-
Constructor Detail
-
RDFWriter
public RDFWriter(File file) throws FileNotFoundException
Creates a new instance that will write data to the specified file.- Parameters:
file- The file to write the mapping set to.- Throws:
FileNotFoundException- If the file exists but cannot be written to for some reason.
-
RDFWriter
public RDFWriter(String filename) throws FileNotFoundException
Creates a new instance that will write data to a file with the specified filename.- Parameters:
filename- The name of the file to write the mapping set to.- Throws:
FileNotFoundException- If the file exists but cannot be written to for some reason.
-
RDFWriter
public RDFWriter(OutputStream stream)
Creates a new instance that will write data to the specified stream.- Parameters:
stream- The stream to write the mapping set to.
-
-
Method Detail
-
setInjectDirectTriples
public void setInjectDirectTriples(boolean withDirectTriples)
Configures the writer to inject “direct triples” or not.- Parameters:
withDirectTriples- Iftrue, for every mapping record the writer will inject a triple of the form?subject_id ?predicate_id ?object_id .in addition to the standard reified representation of the record.
-
doWrite
protected void doWrite(MappingSet mappingSet) throws IOException
Description copied from class:SSSOMWriterActually serialises a mapping set. This method should be overridden by derived classes to implement the serialisation in a specific format.- Specified by:
doWritein classSSSOMWriter- Parameters:
mappingSet- The mapping set to serialise.- Throws:
IOException- If an I/O error occurs.
-
-