本文整理汇总了Java中org.semanticweb.owlapi.io.RDFXMLOntologyFormat类的典型用法代码示例。如果您正苦于以下问题:Java RDFXMLOntologyFormat类的具体用法?Java RDFXMLOntologyFormat怎么用?Java RDFXMLOntologyFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RDFXMLOntologyFormat类属于org.semanticweb.owlapi.io包,在下文中一共展示了RDFXMLOntologyFormat类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: exportOntology
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
@Override
public void exportOntology(String ontologyName, OutputStream os,
OntologyFormat format, Collection<Datasource> xrefDatasources)
throws OntologyNotFoundException {
Ontology ontology = ontologyDAO.loadByName(ontologyName);
if(ontology == null || ontology.isCodelist()) {
throw new OntologyNotFoundException("Ontology not found: " + ontologyName, ontologyName);
}
logger.info("Exporting " + ontology.getName() + " ontology in " + format + " format");
switch(format) {
case OBO:
exportAsOBO(ontology, os, xrefDatasources);
break;
case RDFXML:
exportAsOWL(ontology, os, new RDFXMLOntologyFormat(), xrefDatasources);
break;
case OWLXML:
exportAsOWL(ontology, os, new OWLXMLOntologyFormat(), xrefDatasources);
break;
case Manchester:
exportAsOWL(ontology, os, new ManchesterOWLSyntaxOntologyFormat(), xrefDatasources);
break;
case Turtle:
exportAsOWL(ontology, os, new TurtleOntologyFormat(), xrefDatasources);
break;
default:
throw new IllegalArgumentException("Invalid/Unsupported ontology export format: " + format);
}
}
开发者ID:Novartis,项目名称:ontobrowser,代码行数:33,代码来源:OntologyExportServiceImpl.java
示例2: saveExtractedModule
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
public void saveExtractedModule(OWLOntologyManager manager, OWLOntology module, String physicalModuleURI) {
//OWLOntologyManager ontologyModuleManager = OWLManager.createOWLOntologyManager();
try {
manager.saveOntology(module, new RDFXMLOntologyFormat(), IRI.create(physicalModuleURI));
}
catch (Exception e) {
System.err.println("Error saving module\n" + e.getLocalizedMessage());
e.printStackTrace();
}
}
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:12,代码来源:OntologyModuleExtractor.java
示例3: saveExtractedModule
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
public void saveExtractedModule(String physicalModuleURI) {
//OWLOntologyManager ontologyModuleManager = OWLManager.createOWLOntologyManager();
try {
ontologyManager.saveOntology(module, new RDFXMLOntologyFormat(), IRI.create(physicalModuleURI));
}
catch (Exception e) {
System.err.println("Error saving module\n" + e.getLocalizedMessage());
e.printStackTrace();
}
}
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:12,代码来源:ModuleExtractor.java
示例4: save
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
public void save (SKOSDataset vocab, SKOSFormat format, URI uri) throws SKOSStorageException {
SKOSDatasetImpl setImpl = (SKOSDatasetImpl) vocab;
try {
man.saveOntology(setImpl.getAsOWLOntology(), new RDFXMLOntologyFormat(), IRI.create(uri));
} catch (OWLOntologyStorageException e) {
new SKOSStorageException(e);
}
}
开发者ID:simonjupp,项目名称:java-skos-api,代码行数:9,代码来源:SKOSManager.java
示例5: getMergedOntology
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
public OWLOntology getMergedOntology() {
final IRI mergedOntologyIRI = IRI.create(queryOntology.getOntologyID()
.getDefaultDocumentIRI() + "-merged");
final OWLOntologyManager mm = controller.getOWLOntologyManager();
if (mm.contains(mergedOntologyIRI)) {
return mm.getOntology(mergedOntologyIRI);
} else {
try {
final OWLOntology mergedOntology = mm
.createOntology(mergedOntologyIRI);
mm.setOntologyFormat(mergedOntology, new RDFXMLOntologyFormat());
final String mergedOntologyFileName = mergedOntologyIRI
.toURI()
.toString()
.substring(
mergedOntologyIRI.toURI().toString()
.lastIndexOf("/") + 1)
+ ".owl";
mm.setOntologyDocumentIRI(
mergedOntology,
IRI.create(controller.getRuleSpec().getOutputDir()
.toURI()
+ "/" + mergedOntologyFileName));
mm.applyChange(new AddImport(mergedOntology, mm
.getOWLDataFactory().getOWLImportsDeclaration(
queryOntology.getOntologyID()
.getDefaultDocumentIRI())));
return mergedOntology;
} catch (OWLOntologyCreationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
}
开发者ID:psiotwo,项目名称:sdlnot-rules,代码行数:36,代码来源:SparqlDLNotRulesEngine.java
示例6: saveOntologyCopy
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
private void saveOntologyCopy(File file) throws OWLOntologyStorageException {
IRI newOntologyIRI = IRI.create(file.toURI());
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
manager.saveOntology(ontology, new RDFXMLOntologyFormat(), newOntologyIRI);
}
开发者ID:ModelWriter,项目名称:Source,代码行数:6,代码来源:OntoModel.java
示例7: saveOntology
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
public static synchronized void saveOntology(OWLOntologyManager moduleManager, OWLOntology ontology, String IRIstr) throws Exception{
moduleManager.saveOntology(
ontology, new RDFXMLOntologyFormat(), IRI.create(IRIstr));
}
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:6,代码来源:SynchronizedOWLManager.java
示例8: writeModel
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
public void writeModel(String filePath) throws OWLOntologyStorageException{
// "/home/mikel/git/NCBITaxonomy2OWL/test_new_new.owl"
File out_owl_file = new File(filePath);
RDFXMLOntologyFormat rdfxmlformat = new RDFXMLOntologyFormat();
manager.saveOntology(ontology,rdfxmlformat, IRI.create(out_owl_file.toURI()));
}
开发者ID:mikel-egana-aranguren,项目名称:NCBITaxonomy2OWL,代码行数:7,代码来源:NCBIOWLStore.java
示例9: saveOutputFile
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
/**
* Saves owl ontology with mappings
*/
public void saveOutputFile() throws Exception{
managerMappingsOnto.applyChanges(listAxioms2Add);
managerMappingsOnto.saveOntology(mappingsOnto, new RDFXMLOntologyFormat(), IRI.create(output_file));
}
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:10,代码来源:OWLAlignmentFormat.java
示例10: saveOntology
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
public void saveOntology(String phy_iri_onto) throws Exception{
managerOnto.saveOntology(onto, new RDFXMLOntologyFormat(), IRI.create(phy_iri_onto));
}
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:6,代码来源:OntologyLoader.java
示例11: saveOWLMappingsFile
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; //导入依赖的package包/类
private void saveOWLMappingsFile() throws Exception {
mappings_ontologyManager.applyChanges(owl_changes);
mappings_ontologyManager.saveOntology(mappings_ontology, new RDFXMLOntologyFormat(), IRI.create(mappings_owl_file_name));
}
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:7,代码来源:FromRDFAlign2OWL.java
注:本文中的org.semanticweb.owlapi.io.RDFXMLOntologyFormat类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论