• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java StringDocumentTarget类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.semanticweb.owlapi.io.StringDocumentTarget的典型用法代码示例。如果您正苦于以下问题:Java StringDocumentTarget类的具体用法?Java StringDocumentTarget怎么用?Java StringDocumentTarget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

StringDocumentTarget类属于org.semanticweb.owlapi.io包,在下文中一共展示了StringDocumentTarget类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: parseImports

点赞 3

import org.semanticweb.owlapi.io.StringDocumentTarget; //导入依赖的package包/类
/**
         * Method that uses the loaded ontology and parses it in case there are imports that have not been considered
         * @param considerImportedOntologies
         * @param manager
         * @param ontology
         * @return
         * @throws OWLOntologyCreationException
         * @throws OWLOntologyStorageException
         * @throws URISyntaxException 
         */
	private static String parseImports(
                        boolean considerImportedOntologies, 
                        OWLOntologyManager manager,
                        OWLOntology ontology) 
	throws OWLOntologyCreationException, OWLOntologyStorageException, URISyntaxException {
            String result = "";
            if (considerImportedOntologies) {
                //considerImportedClosure || //<- removed for the moment
                Set<OWLOntology> setOfImportedOntologies = new HashSet<OWLOntology>();
                setOfImportedOntologies.addAll(ontology.getDirectImports());
//                else {
//                        setOfImportedOntologies.addAll(ontology.getImportsClosure());
//                }
                for (OWLOntology importedOntology : setOfImportedOntologies) {
                        manager.addAxioms(ontology, importedOntology.getAxioms());
                }
            }
            OWLOntologyDocumentTarget parsedOntology = new StringDocumentTarget();
            manager.saveOntology(ontology,new RDFXMLDocumentFormat(), parsedOntology);
            result = parsedOntology.toString();
//		}

            return result;
	}
 

开发者ID:dgarijo,
项目名称:Widoco,
代码行数:35,
代码来源:LODEGeneration.java

示例2: writeInternal

点赞 2

import org.semanticweb.owlapi.io.StringDocumentTarget; //导入依赖的package包/类
@Override
protected void writeInternal(OWLOntology ontology, HttpOutputMessage httpOutputMessage)
    throws IOException, HttpMessageNotWritableException {
  OWLOntologyDocumentTarget target = new StringDocumentTarget();

  try {
    ontology.saveOntology(documentFormat, target);
  } catch (OWLOntologyStorageException e) {
    // should not happpen
    throw new IllegalStateException(e);
  }

  httpOutputMessage.getBody().write(target.toString().getBytes());
}
 

开发者ID:VisualDataWeb,
项目名称:OntoBench,
代码行数:15,
代码来源:OntologyHttpMessageConverter.java

示例3: dumpOWL

点赞 2

import org.semanticweb.owlapi.io.StringDocumentTarget; //导入依赖的package包/类
/**
 * Simple method to write an OWL structure to <code>System.out</code>. It is basically a wrapper
 * for the writeOntology method.
 *
 * @param ontology the ontology to display
 */
public void dumpOWL(OWLOntology ontology) {
    try {
        StringDocumentTarget sdt = new StringDocumentTarget();
        writeOntology(ontology, sdt);
        System.out.println(sdt);
    } catch (Exception e) {
        // this is where Scala would be nice.
        throw new RuntimeException(e);
    }
}
 

开发者ID:jottinger,
项目名称:owlapi-tutorial,
代码行数:17,
代码来源:OntologyHelper.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)