本文整理汇总了Java中org.semanticweb.owlapi.owlxml.renderer.OWLXMLRenderer类的典型用法代码示例。如果您正苦于以下问题:Java OWLXMLRenderer类的具体用法?Java OWLXMLRenderer怎么用?Java OWLXMLRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OWLXMLRenderer类属于org.semanticweb.owlapi.owlxml.renderer包,在下文中一共展示了OWLXMLRenderer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.semanticweb.owlapi.owlxml.renderer.OWLXMLRenderer; //导入依赖的package包/类
/**
* This is the entry point to execute the ontology filter.
*
* @param args
* arguments
* @throws IOException
* if something went wrong with I/O
* @throws OWLException
* if something went wrong when using the OWL API
*/
public static void main(String[] args) throws IOException, OWLException {
Objects.requireNonNull(args);
if (args.length == 3) {
String minuendFileName = args[0];
String subtrahendFileName = args[1];
String outputFileName = args[2];
OntologyFilter instance = new OntologyFilter();
OWLOntology subtrahendOntology = readOntology(subtrahendFileName);
instance.filter(minuendFileName, outputFileName, new SubtractionFilter(subtrahendOntology.getAxioms()),
new OWLXMLRenderer());
} else {
System.out.println(HELP);
}
}
示例2: main
import org.semanticweb.owlapi.owlxml.renderer.OWLXMLRenderer; //导入依赖的package包/类
/**
* This is the entry point to execute the cycle remover.
*
* @param args
* arguments
* @throws IOException
* if something went wrong with I/O
* @throws OWLException
* if something went wrong with the OWL API
*/
public static void main(String[] args) throws IOException, OWLException {
Objects.requireNonNull(args);
if (args.length == 2) {
String ontologyFileName = args[0];
String outputFileName = args[1];
CycleRemover instance = new CycleRemover();
instance.removeCycle(ontologyFileName, outputFileName, new OWLXMLRenderer());
} else {
System.out.println(HELP);
}
}
示例3: main
import org.semanticweb.owlapi.owlxml.renderer.OWLXMLRenderer; //导入依赖的package包/类
/**
* This is the entry point to execute the module extractor.
*
* @param args
* arguments
* @throws IOException
* if something went wrong with I/O
* @throws OWLException
* if something went wrong when using the OWL API
*/
public static void main(String[] args) throws IOException, OWLException {
Objects.requireNonNull(args);
if (args.length == 3) {
boolean storingModuleMode = false;
int repetitions = 1;
try {
repetitions = Integer.parseInt(args[1]);
} catch (NumberFormatException e) {
storingModuleMode = true;
}
String ontologyFileName = args[0];
String outputFileName = args[2];
BornModuleExtractor instance = new BornModuleExtractor();
if (storingModuleMode) {
String signatureFileName = args[1];
instance.extractModule(ontologyFileName, signatureFileName, outputFileName, new OWLXMLRenderer());
} else {
instance.countRandom(ontologyFileName, repetitions, outputFileName);
}
} else {
System.out.println(HELP);
}
}
示例4: main
import org.semanticweb.owlapi.owlxml.renderer.OWLXMLRenderer; //导入依赖的package包/类
/**
* This is the entry point to execute the ontology filter.
*
* @param args
* arguments
* @throws IOException
* if something went wrong with I/O
* @throws OWLException
* if something went wrong when using the OWL API
*/
public static void main(String[] args) throws IOException, OWLException {
Objects.requireNonNull(args);
if (args.length == 2) {
String ontologyFileName = args[0];
String outputFileName = args[1];
OntologyFilter instance = new OntologyFilter();
instance.filter(ontologyFileName, outputFileName, new ElAxiomFilter(), new OWLXMLRenderer());
} else {
System.out.println(HELP);
}
}
示例5: storeOWLOntology
import org.semanticweb.owlapi.owlxml.renderer.OWLXMLRenderer; //导入依赖的package包/类
void storeOWLOntology(OWLOntology ontology, OutputStream ontologyOutputStream)
throws IOException, OWLRendererException {
Objects.requireNonNull(ontology);
Objects.requireNonNull(ontologyOutputStream);
AbstractOWLRenderer renderer = new OWLXMLRenderer();
renderer.render(ontology, ontologyOutputStream);
ontologyOutputStream.flush();
}
示例6: renderOWL
import org.semanticweb.owlapi.owlxml.renderer.OWLXMLRenderer; //导入依赖的package包/类
/**
* Render the given ontology as a string in OWL XML format.
*
* @param owlOntology
* the input ontology
* @return the OWL XML representation of the input ontology
* @throws OWLRendererException
* if an error occurred during rendering
*/
private static String renderOWL(OWLOntology owlOntology) throws OWLRendererException {
PrintWriter writer = new PrintWriter(new StringWriter());
OWLXMLRenderer renderer = new OWLXMLRenderer();
renderer.render(owlOntology, writer);
writer.flush();
return writer.toString();
}
示例7: storeOWLOntology
import org.semanticweb.owlapi.owlxml.renderer.OWLXMLRenderer; //导入依赖的package包/类
/**
* Stores an ontology
*
* @param ontology
* ontology
* @param ontologyOutputStream
* output stream to store the ontology
* @throws IOException
* if something went wrong with the I/O
* @throws OWLRendererException
* if the ontology could not be rendered
*/
void storeOWLOntology(OWLOntology ontology, OutputStream ontologyOutputStream)
throws IOException, OWLRendererException {
Objects.requireNonNull(ontology);
Objects.requireNonNull(ontologyOutputStream);
AbstractOWLRenderer renderer = new OWLXMLRenderer();
renderer.render(ontology, ontologyOutputStream);
ontologyOutputStream.flush();
}