當前位置: 首頁>>代碼示例>>Java>>正文


Java IRIDocumentSource類代碼示例

本文整理匯總了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);
	}
}
 
開發者ID:rsgoncalves,項目名稱:ecco,代碼行數:22,代碼來源:LaconicJustificationFinder.java

示例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;
}
 
開發者ID:rsgoncalves,項目名稱:ecco,代碼行數:23,代碼來源:EccoRunner.java

示例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));
}
 
開發者ID:psnc-dl,項目名稱:darceo,代碼行數:19,代碼來源:OntologyManager.java

示例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);
}
 
開發者ID:geneontology,項目名稱:minerva,代碼行數:7,代碼來源:CoreMolecularModelManagerTest.java


注:本文中的org.semanticweb.owlapi.io.IRIDocumentSource類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。