public class ModelUtils extends Object
Constructor and Description |
---|
ModelUtils() |
Modifier and Type | Method and Description |
---|---|
static Model |
complement(Model a,
Model b,
Model result) |
static void |
convert(File[] inFiles,
Syntax[] inSyntax,
File out,
Syntax outSyntax)
Merge all input files into one model and export to outfile in output
syntax
|
static void |
convert(File in,
Syntax inSyntax,
File out,
Syntax outSyntax)
Convert the input file, interpreted in the inputSyntax to outputFile, in
outputSyntax.
|
static void |
copy(Model source,
Model target)
If the two models come from different implementations, copying blank
nodes needs special care
|
static void |
copy(ModelSet source,
ModelSet target)
Copy data from the source modelset to the target modelset.
|
static void |
deanonymize(Model m)
Replace all BlankNodes as Subjects or Objects from the Statements in the
given RDF2Go model.
|
static Model |
intersection(Model a,
Model b,
Model result) |
static Model |
loadFromFile(File in,
Syntax inSyntax)
Deprecated.
This method creates new models via RDF2Go. If multiple model
factories are used, this might be wrong. Use instead public
static void loadFromFile(File in, Syntax inSyntax, Model
sinkModel)
|
static void |
loadFromFile(File in,
Syntax inSyntax,
Model sinkModel)
Convenience method to load data from file in in syntax inSyntax and write
loaded triples to sinkModel.
|
static void |
removeFrom(ModelSet source,
ModelSet target)
Remove data that is listed in the source modelset from the target
modelset.
|
static int |
size(Iterable<?> it)
Count statements in iterable 'it'
|
static int |
size(Iterator<?> i)
Count statements in iterator 'it'
|
static Model |
union(Model a,
Model b,
Model result) |
static void |
writeToFile(Model model,
File outFile,
Syntax outSyntax) |
public static int size(Iterable<?> it)
it
- the iterablepublic static int size(Iterator<?> i)
i
- the iteratorpublic static void copy(ModelSet source, ModelSet target) throws ModelRuntimeException
source
- the source, data from here is takentarget
- the target, data will be put here.ModelRuntimeException
- if the copying process has an errorpublic static void copy(Model source, Model target)
source
- copy from wheretarget
- copy where topublic static void removeFrom(ModelSet source, ModelSet target) throws ModelRuntimeException
source
- the source, data from here is evaluatedtarget
- the target, data contained in source and target are removed
from hereModelRuntimeException
- if the deleting process has an errorpublic static Model intersection(Model a, Model b, Model result) throws ModelRuntimeException
a
- a Modelb
- a modelresult
- should be empty before calling this methodModelRuntimeException
- from underlying IO errors, if any.public static Model union(Model a, Model b, Model result) throws ModelRuntimeException
a
- a Modelb
- a Modelresult
- should be empty before calling this methodModelRuntimeException
- from underlying IO errors, if any.public static Model complement(Model a, Model b, Model result) throws ModelRuntimeException
a
- a Modelb
- a Modelresult
- the resulting Model, should be empty before calling this
methodModelRuntimeException
- from underlying IO errors, if any.public static void convert(File in, Syntax inSyntax, File out, Syntax outSyntax) throws FileNotFoundException
in
- input FileinSyntax
- used to read input fileout
- output FileoutSyntax
- used to write output fileFileNotFoundException
- as the name says@Deprecated public static Model loadFromFile(File in, Syntax inSyntax) throws ModelRuntimeException, IOException
in
- DeprecatedinSyntax
- DeprecatedModelRuntimeException
- from underlying IO errors, if any.IOException
- Deprecatedpublic static void loadFromFile(File in, Syntax inSyntax, Model sinkModel) throws ModelRuntimeException, IOException
in
- input fileinSyntax
- used to read input filesinkModel
- where to write the loaded content. This model is not
cleared. This model should be open.ModelRuntimeException
- from underlying IO errors, if any.IOException
- from file readingpublic static void writeToFile(Model model, File outFile, Syntax outSyntax) throws ModelRuntimeException, IOException
ModelRuntimeException
IOException
public static void convert(File[] inFiles, Syntax[] inSyntax, File out, Syntax outSyntax) throws ModelRuntimeException, IOException
IOException
- from file readingModelRuntimeException
- from underlying IO errors, if any.public static void deanonymize(Model m)
m
- de-anonymise this modelCopyright © 2005–2016 IT-Consulting Dr. Max V?lkel | Project started at FZI Forschungszentrum Informatik, www.fzi.de. All rights reserved.