本文整理汇总了Java中org.semanticweb.owlapi.model.IRI.getFragment方法的典型用法代码示例。如果您正苦于以下问题:Java IRI.getFragment方法的具体用法?Java IRI.getFragment怎么用?Java IRI.getFragment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.IRI
的用法示例。
在下文中一共展示了IRI.getFragment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeViewClassIRI
import org.semanticweb.owlapi.model.IRI; //导入方法依赖的package包/类
public IRI makeViewClassIRI(IRI vcIRI, IRI vpIRI, String sep, boolean isUseOriginalClassIRIs, boolean isAssumeOBOStyleIRIs) {
if (!isUseOriginalClassIRIs) {
String vcIRIstr = vcIRI.toString();
if (isAssumeOBOStyleIRIs) {
String baseId = Owl2Obo.getIdentifier(vcIRI);
String relId = Owl2Obo.getIdentifier(vpIRI);
vcIRIstr = Obo2OWLConstants.DEFAULT_IRI_PREFIX
+ baseId.replace(":", "_") + sep
+ relId.replace("_", "-").replace(":", "-");
}
else {
String frag = vpIRI.getFragment();
if (frag == null || frag.equals("")) {
frag = vpIRI.toString().replaceAll(".*\\/", "view");
}
vcIRIstr = vcIRIstr + sep + frag;
}
vcIRI = IRI.create(vcIRIstr);
}
return vcIRI;
}
示例2: makeViewClassIRI
import org.semanticweb.owlapi.model.IRI; //导入方法依赖的package包/类
public IRI makeViewClassIRI(IRI vcIRI, IRI vpIRI, String sep) {
if (!isUseOriginalClassIRIs) {
String vcIRIstr = vcIRI.toString();
if (isAssumeOBOStyleIRIs) {
String baseId = Owl2Obo.getIdentifier(vcIRI);
String relId = Owl2Obo.getIdentifier(vpIRI);
vcIRIstr = Obo2OWLConstants.DEFAULT_IRI_PREFIX
+ baseId.replace(":", "_") + sep
+ relId.replace("_", "-").replace(":", "-");
}
else {
String frag = vpIRI.getFragment();
if (frag == null || frag.equals("")) {
frag = vpIRI.toString().replaceAll(".*\\/", "view");
}
vcIRIstr = vcIRIstr + sep + frag;
}
vcIRI = IRI.create(vcIRIstr);
}
return vcIRI;
}
示例3: printOWLObject
import org.semanticweb.owlapi.model.IRI; //导入方法依赖的package包/类
private void printOWLObject(OWLObject obj, String del) {
String id;
if (obj instanceof OWLNamedObject) {
IRI iri = ((OWLNamedObject)obj).getIRI();
if (iri.getFragment() != null) {
id = iri.getFragment();
}
else {
id = iri.toString();
id = id.replaceAll(".*/", "");
}
}
else {
/*
if (obj instanceof OWLObjectIntersectionOf) {
s.print("and");
for (OWLClassExpression sx : ((OWLObjectIntersectionOf)x).getOperands()) {
printX(s, sx, depth+1);
}
}
else if (x instanceof OWLObjectUnionOf) {
s.print("or");
for (OWLClassExpression sx : ((OWLObjectUnionOf)x).getOperands()) {
printX(s, sx, depth+1);
}
}
else if (x instanceof OWLQuantifiedRestriction) {
OWLQuantifiedRestriction qr = (OWLQuantifiedRestriction)x;
s.print(qr.getProperty().toString()+" "+qr.getClassExpressionType());
printX(s, qr.getFiller(), depth+1);
}
*/
// todo - show class expressions
id = obj.toString();
}
printStream.print(id);
String label = graph.getLabel(obj);
if (label == null) {
label = "";
}
printStream.print(del);
printStream.print("\'"+label+"\'");
}