当前位置: 首页>>代码示例>>Java>>正文


Java OWLOntologyID.getVersionIRI方法代码示例

本文整理汇总了Java中org.semanticweb.owlapi.model.OWLOntologyID.getVersionIRI方法的典型用法代码示例。如果您正苦于以下问题:Java OWLOntologyID.getVersionIRI方法的具体用法?Java OWLOntologyID.getVersionIRI怎么用?Java OWLOntologyID.getVersionIRI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.semanticweb.owlapi.model.OWLOntologyID的用法示例。


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

示例1: handleVersion

import org.semanticweb.owlapi.model.OWLOntologyID; //导入方法依赖的package包/类
private String handleVersion(String ontologyId) {
	// TODO add an option to set/overwrite the version manually via command-line
	// TODO re-use/create a method in obo2owl for creating an version IRI
	String version;
	OWLOntology ontology = mooncat.getOntology();
	OWLOntologyID owlOntologyId = ontology.getOntologyID();
	Optional<IRI> versionIRI = owlOntologyId.getVersionIRI();
	if (versionIRI.isPresent() == false) {
		// set a new version IRI using the current date
		version = OntologyVersionTools.format(new Date());
		versionIRI = Optional.of(IRI.create(Obo2OWLConstants.DEFAULT_IRI_PREFIX+ontologyId+"/"+oortConfig.getVersionSubdirectory()+"/"+version+"/"+ontologyId+".owl"));
		
		OWLOntologyManager m = mooncat.getManager();
		m.applyChange(new SetOntologyID(ontology, new OWLOntologyID(owlOntologyId.getOntologyIRI(), versionIRI)));
	}
	else {
		String versionIRIString = versionIRI.get().toString();
		version = OntologyVersionTools.parseVersion(versionIRIString);
		if (version == null) {
			// use the whole IRI? escape?
			logError("Could not parse a version from ontolgy version IRI: "+versionIRIString);
			version = versionIRIString;
		}
	}
	return version;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:27,代码来源:OboOntologyReleaseRunner.java

示例2: visit

import org.semanticweb.owlapi.model.OWLOntologyID; //导入方法依赖的package包/类
@Override
public Void visit(OWLOntology ontology) {
  this.ontology = Optional.of(ontology);
  this.definingOntology = OwlApiUtils.getIri(ontology);
  Long versionNodeID = null;
  Long ontologyNodeID = null;
  OWLOntologyID id = ontology.getOntologyID();
  if (null == id.getOntologyIRI()) {
    logger.fine("Ignoring null ontology ID for " + ontology.toString());
  } else {
    ontologyNodeID = getOrCreateNode(id.getOntologyIRI().toString(), OwlLabels.OWL_ONTOLOGY);
  }
  if (null != id.getVersionIRI()){
    versionNodeID = getOrCreateNode(id.getVersionIRI().toString(), OwlLabels.OWL_ONTOLOGY);
  }
  if (null != ontologyNodeID && null != versionNodeID) {
    graph.createRelationship(ontologyNodeID, versionNodeID, OwlRelationships.OWL_VERSION_IRI);
  }
  return null;
}
 
开发者ID:SciGraph,项目名称:SciGraph,代码行数:21,代码来源:GraphOwlVisitor.java

示例3: appendOntologyId

import org.semanticweb.owlapi.model.OWLOntologyID; //导入方法依赖的package包/类
private void appendOntologyId(OWLOntologyID ontologyID, StringBuilder sb) {
	Optional<IRI> ontologyIRI = ontologyID.getOntologyIRI();
	if (ontologyIRI.isPresent()) {
		sb.append("Ontology(id=").append(ontologyIRI.get());
		Optional<IRI> versionIRI = ontologyID.getVersionIRI();
		if (versionIRI .isPresent()) {
			sb.append(", version=").append(versionIRI.get());
		}
		sb.append(")");
		
	}
	else {
		sb.append("Ontology with no ID");
	}
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:16,代码来源:BioChebiGenerator.java


注:本文中的org.semanticweb.owlapi.model.OWLOntologyID.getVersionIRI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。