本文整理汇总了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;
}
示例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;
}
示例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");
}
}