我需要将此OWL本体文件转换为JSON,以便将其集成到HTML5网页中进行可视化:this is the OWL ontology file in question
eqqqjvef1#
我使用的WebVOWL工具,http://vowl.visualdataweb.org/webvowl/owl2vowl_0.1.4.zip的工作相当不错。该命令为java -jar owl2vowl.jar -file yourfile.owl祝你好运
java -jar owl2vowl.jar -file yourfile.owl
yvt65v4c2#
OWL API版本4.0.1可以保存为两个JSON变体:RDFJsonDocumentFormat和RDFJsonLDDocumentFormat。为了使用它们,需要将它们指定为OWLOntologyManager::save()的参数。例如,https://github.com/owlcs/owlapi/wiki/Documentation
RDFJsonDocumentFormat
RDFJsonLDDocumentFormat
OWLOntologyManager::save()
5n0oy7gb3#
下面是Ignazio提到的方法的工作示例:
OWLOntologyManager m = OWLManager.createOWLOntologyManager(); OWLOntology o = m.loadOntologyFromOntologyDocument(new File("my/path/file.owl")); StringDocumentTarget target = new StringDocumentTarget(); org.semanticweb.owlapi.formats.RDFJsonDocumentFormat documentFormat = new RDFJsonDocumentFormat(); m.saveOntology(o, documentFormat, target); FileWriter writer = new FileWriter(new File("thesaurus.json")); writer.write(target.toString()); writer.close();
字符串
3条答案
按热度按时间eqqqjvef1#
我使用的WebVOWL工具,http://vowl.visualdataweb.org/webvowl/owl2vowl_0.1.4.zip的工作相当不错。
该命令为
java -jar owl2vowl.jar -file yourfile.owl
祝你好运
yvt65v4c2#
OWL API版本4.0.1可以保存为两个JSON变体:
RDFJsonDocumentFormat
和RDFJsonLDDocumentFormat
。为了使用它们,需要将它们指定为
OWLOntologyManager::save()
的参数。例如,https://github.com/owlcs/owlapi/wiki/Documentation
5n0oy7gb3#
下面是Ignazio提到的方法的工作示例:
字符串