本文整理汇总了Java中org.semanticweb.owlapi.formats.TurtleDocumentFormat类的典型用法代码示例。如果您正苦于以下问题:Java TurtleDocumentFormat类的具体用法?Java TurtleDocumentFormat怎么用?Java TurtleDocumentFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TurtleDocumentFormat类属于org.semanticweb.owlapi.formats包,在下文中一共展示了TurtleDocumentFormat类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveOntology
import org.semanticweb.owlapi.formats.TurtleDocumentFormat; //导入依赖的package包/类
static void saveOntology(OWLOntology ontology, File file) throws Exception {
if (file.getName().endsWith(".ttl")) {
manager.saveOntology(ontology, new TurtleDocumentFormat(), new FileOutputStream(file));
} else if (file.getName().endsWith(".xml")) {
manager.saveOntology(ontology, new OWLXMLDocumentFormat(), new FileOutputStream(file));
} else {
manager.saveOntology(ontology, new RDFXMLDocumentFormat(), new FileOutputStream(file));
}
}
示例2: simSaveICCache
import org.semanticweb.owlapi.formats.TurtleDocumentFormat; //导入依赖的package包/类
@CLIMethod("--sim-save-ic-cache")
public void simSaveICCache(Opts opts) throws Exception {
opts.info("OUTFILE", "saves ICs as RDF/turtle cache");
if (owlsim == null) {
owlsim = getOwlSimFactory().createOwlSim(g.getSourceOntology());
owlsim.createElementAttributeMapFromOntology();
}
OWLOntology o = owlsim.cacheInformationContentInOntology();
TurtleDocumentFormat fmt = new TurtleDocumentFormat();
fmt.setPrefix("obo", "http://purl.obolibrary.org/obo/");
fmt.setPrefix("sim", "http://owlsim.org/ontology/");
g.getManager().saveOntology(o,
fmt,
IRI.create(opts.nextFile()));
}
示例3: testTranslate
import org.semanticweb.owlapi.formats.TurtleDocumentFormat; //导入依赖的package包/类
@Test
public void testTranslate() throws Exception {
ParserWrapper pw = new ParserWrapper();
OWLOntology o = pw.parseOWL(getResourceIRIString("mooncat/shadow-tbox-test.owl"));
OWLInAboxTranslator t = new OWLInAboxTranslator(o);
OWLOntology abox = t.translate();
o.getOWLOntologyManager().saveOntology(abox,
new TurtleDocumentFormat(),
new FileOutputStream("target/shadow-abox.ttl"));
}
示例4: getFormat
import org.semanticweb.owlapi.formats.TurtleDocumentFormat; //导入依赖的package包/类
@Override
public OWLDocumentFormat getFormat() {
return new TurtleDocumentFormat();
}