本文整理汇总了Java中org.semanticweb.owlapi.io.IRIDocumentSource类的典型用法代码示例。如果您正苦于以下问题:Java IRIDocumentSource类的具体用法?Java IRIDocumentSource怎么用?Java IRIDocumentSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRIDocumentSource类属于org.semanticweb.owlapi.io包,在下文中一共展示了IRIDocumentSource类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.semanticweb.owlapi.io.IRIDocumentSource; //导入依赖的package包/类
/**
* Main
* @param args Arguments
*/
public static void main(String[] args) {
String entailment = args[0];
String justification = args[1];
OWLOntologyManager man = OWLManager.createOWLOntologyManager();
OWLOntology ent = null, just = null;
try {
ent = man.loadOntologyFromOntologyDocument(new IRIDocumentSource(IRI.create("file:" + entailment)));
just = man.loadOntologyFromOntologyDocument(new IRIDocumentSource(IRI.create("file:" + justification)));
} catch (OWLOntologyCreationException e) {
e.printStackTrace();
}
if(ent != null && just != null) {
LaconicJustificationFinder finder = new LaconicJustificationFinder(ent, just);
String out = finder.getLaconicJustificationAsString();
System.out.println(out);
}
}
示例2: loadOntology
import org.semanticweb.owlapi.io.IRIDocumentSource; //导入依赖的package包/类
/**
* Load ontology from a file path
* @param ontNr Ontology number
* @param filepath Ontology file path
* @param localFile true if local file, false otherwise
* @return Loaded ontology
*/
public OWLOntology loadOntology(int ontNr, String filepath, boolean localFile) {
String filename = filepath.substring(filepath.lastIndexOf(File.separator)+1, filepath.length());
System.out.println("Input " + ontNr + ": " + filename + " (" + filepath + ")");
if(filepath.contains("\\")) filepath = filepath.replace("\\", "/");
// Load ontology
OWLOntology ont = null;
try {
if(localFile) ont = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(new IRIDocumentSource(IRI.create("file:///" + filepath)), config);
else ont = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(new IRIDocumentSource(IRI.create(filepath)), config);
} catch (OWLOntologyCreationException e) {
e.printStackTrace();
}
return ont;
}
示例3: loadOntology
import org.semanticweb.owlapi.io.IRIDocumentSource; //导入依赖的package包/类
/**
* Loads new ontology into the manager.
*
* @param iri
* {@link IRI} of the service ontology to load.
* @return loaded ontology representation.
* @throws OWLOntologyCreationException
* should any problem with ontology loading occur.
*/
public OWLOntology loadOntology(IRI iri)
throws OWLOntologyCreationException {
logger.debug("Extracting information out of descriptor " + iri);
// OWLOntologyIRIMapperImpl mapper = new OWLOntologyIRIMapperImpl();
// mapper.addMapping(IRI.create("http://cds.synat.pcss.pl/jpgbmp/Service.owl"), iri);
// MANAGER.addIRIMapper(mapper);
//return MANAGER.loadOntologyFromOntologyDocument(iri);
return MANAGER.loadOntologyFromOntologyDocument(new IRIDocumentSource(iri));
}
示例4: testSyntaxErrorModel
import org.semanticweb.owlapi.io.IRIDocumentSource; //导入依赖的package包/类
@Test(expected=UnparsableOntologyException.class)
public void testSyntaxErrorModel() throws Exception {
OWLOntologyManager m = OWLManager.createOWLOntologyManager();
final IRI modelFile = IRI.create(new File("src/test/resources/syntax-error/5667fdd400000802").getAbsoluteFile());
CoreMolecularModelManager.loadOntologyDocumentSource(new IRIDocumentSource(modelFile), false, m);
}