本文整理汇总了Java中org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom类的典型用法代码示例。如果您正苦于以下问题:Java OWLDisjointObjectPropertiesAxiom类的具体用法?Java OWLDisjointObjectPropertiesAxiom怎么用?Java OWLDisjointObjectPropertiesAxiom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OWLDisjointObjectPropertiesAxiom类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLDisjointObjectPropertiesAxiom类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: splitToAnnotatedPairs
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
@Override
public Set<OWLDisjointObjectPropertiesAxiom> splitToAnnotatedPairs() {
List<OWLObjectPropertyExpression> ops = new ArrayList<>(getProperties());
if (ops.size() == 2) {
return Collections
.<OWLDisjointObjectPropertiesAxiom> singleton(this);
}
Set<OWLDisjointObjectPropertiesAxiom> result = new HashSet<>();
for (int i = 0; i < ops.size() - 1; i++) {
OWLObjectPropertyExpression indI = ops.get(i);
OWLObjectPropertyExpression indJ = ops.get(i + 1);
result.add(new OWLDisjointObjectPropertiesAxiomImpl(new HashSet<>(
Arrays.asList(indI, indJ)), getAnnotations()));
}
return result;
}
示例2: visit
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
public void visit(OWLDisjointObjectPropertiesAxiom axiom) {
OWLObjectPropertyExpression[] objectPropertyExpressions=new OWLObjectPropertyExpression[axiom.getProperties().size()];
axiom.getProperties().toArray(objectPropertyExpressions);
for (int i=0;i<objectPropertyExpressions.length;i++) {
objectPropertyExpressions[i]=objectPropertyExpressions[i].getSimplified();
m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(objectPropertyExpressions[i].getNamedProperty());
}
m_axioms.m_disjointObjectProperties.add(objectPropertyExpressions);
}
示例3: visit
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
public Boolean visit(OWLDisjointObjectPropertiesAxiom axiom) {
int n=axiom.getProperties().size();
OWLObjectPropertyExpression[] props=axiom.getProperties().toArray(new OWLObjectPropertyExpression[n]);
for (int i=0;i<n-1;i++)
for (int j=i+1;j<n;j++)
if (!reasoner.isDisjointObjectProperty(props[i],props[j])) return Boolean.FALSE;
return Boolean.TRUE;
}
示例4: visit
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
@Override
public OWLDisjointObjectPropertiesAxiom visit(
ElkDisjointObjectPropertiesAxiom axiom) {
return owlFactory_.getOWLDisjointObjectPropertiesAxiom(
toObjectPropertyExpressionSet(
axiom.getObjectPropertyExpressions()));
}
示例5: visit
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
@Override
public T visit(OWLDisjointObjectPropertiesAxiom axiom) {
throw new IllegalArgumentException(
OWLDisjointObjectPropertiesAxiom.class.getSimpleName()
+ " cannot be converted to "
+ getTargetClass().getSimpleName());
}
示例6: visit
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
/**
* Disjoint Properties are translated into constraints:</br>
* <code>:- r(X,Y), s(X,Y), ...</code>
* @see org.semanticweb.owlapi.model.OWLAxiomVisitor#visit(org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom)
*/
public void visit(OWLDisjointObjectPropertiesAxiom disProperties) {
writer.write("icons " + ASP2CoreSymbols.IMPLICATION);
writer.write(String.format(" activated(%d), ", nConstraints++));
String cVar = var.currentVar();
String nVar = var.nextVariable();
boolean isFirst=true;
for (OWLObjectPropertyExpression property : disProperties.getProperties()) {
String propertyName = mapper.getPredicateName(property.getNamedProperty());
if (!isFirst) {
writer.write(ASP2CoreSymbols.CONJUNCTION);
}
isFirst = false;
writer.write(propertyName);
writer.write(ASP2CoreSymbols.BRACKET_OPEN);
writer.write(cVar);
writer.write(ASP2CoreSymbols.ARG_SEPERATOR);
writer.write(nVar);
writer.write(ASP2CoreSymbols.BRACKET_CLOSE);
}
writer.write(ASP2CoreSymbols.EOR);
}
示例7: visit
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
/**
* Disjoint Properties are translated into constraints:</br>
* <code>:- r(X,Y), s(X,Y), ...</code>
* @see org.semanticweb.owlapi.model.OWLAxiomVisitor#visit(org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom)
*/
public void visit(OWLDisjointObjectPropertiesAxiom disProperties) {
writer.write(ASP2CoreSymbols.IMPLICATION);
String cVar = var.currentVar();
String nVar = var.nextVariable();
boolean isFirst=true;
for (OWLObjectPropertyExpression property : disProperties.getProperties()) {
String propertyName = mapper.getPredicateName(property.getNamedProperty());
if (!isFirst) {
writer.write(ASP2CoreSymbols.CONJUNCTION);
}
isFirst = false;
writer.write(propertyName);
writer.write(ASP2CoreSymbols.BRACKET_OPEN);
writer.write(cVar);
writer.write(ASP2CoreSymbols.ARG_SEPERATOR);
writer.write(nVar);
writer.write(ASP2CoreSymbols.BRACKET_CLOSE);
}
writer.write(ASP2CoreSymbols.EOR);
}
示例8: visit
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
@Override
public void visit(OWLDisjointObjectPropertiesAxiom axiom) {
List<OWLObjectPropertyExpression> propertyExpressions = new LinkedList<>(axiom.getProperties());
for(int i = 0; i < propertyExpressions.size(); i++){
sparql += "{";
OWLObjectPropertyExpression pe = propertyExpressions.remove(i);
if(pe.isAnonymous()){
sparql += objectVar + "<" + pe.getInverseProperty().asOWLObjectProperty().toStringID() + "> " + subjectVar + " .";
} else {
sparql += subjectVar + "<" + pe.asOWLObjectProperty().toStringID() + "> " + objectVar + " .";
}
for (OWLObjectPropertyExpression pe2 : propertyExpressions) {
String pattern;
if(pe2.isAnonymous()){
pattern = objectVar + "<" + pe2.getInverseProperty().asOWLObjectProperty().toStringID() + "> " + subjectVar + " .";
} else {
pattern = subjectVar + "<" + pe2.asOWLObjectProperty().toStringID() + "> " + objectVar + " .";
}
sparql += notExists(pattern);
}
propertyExpressions.add(i, pe);
sparql += "}";
if(i < propertyExpressions.size()-1){
sparql += " UNION ";
}
}
}
示例9: visit
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
@Override
public void visit(@Nonnull OWLDisjointObjectPropertiesAxiom axiom) {
for (OWLObjectPropertyExpression prop : axiom.getProperties()) {
prop.accept(this);
}
processAxiomAnnotations(axiom);
}
示例10: getAxiomWithoutAnnotations
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
@Nonnull
@Override
public OWLDisjointObjectPropertiesAxiom getAxiomWithoutAnnotations() {
if (!isAnnotated()) {
return this;
}
return new OWLDisjointObjectPropertiesAxiomImpl(getProperties(),
NO_ANNOTATIONS);
}
示例11: getAnnotatedAxiom
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
@Nonnull
@Override
public OWLDisjointObjectPropertiesAxiom getAnnotatedAxiom(
@Nonnull Set<OWLAnnotation> annotations) {
return new OWLDisjointObjectPropertiesAxiomImpl(getProperties(),
mergeAnnos(annotations));
}
示例12: asPairwiseAxioms
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
@Nonnull
@Override
public Set<OWLDisjointObjectPropertiesAxiom> asPairwiseAxioms() {
Set<OWLDisjointObjectPropertiesAxiom> result = new HashSet<>();
List<OWLObjectPropertyExpression> list = new ArrayList<>(
getProperties());
for (int i = 0; i < list.size() - 1; i++) {
for (int j = i + 1; j < list.size(); j++) {
result.add(new OWLDisjointObjectPropertiesAxiomImpl(
new HashSet<>(Arrays.asList(list.get(i), list.get(j))),
NO_ANNOTATIONS));
}
}
return result;
}
示例13: equals
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
return obj instanceof OWLDisjointObjectPropertiesAxiom;
}
示例14: visit
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
public void visit(OWLDisjointObjectPropertiesAxiom axiom) {
notSupported(axiom);
}
示例15: convert
import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom; //导入依赖的package包/类
@SuppressWarnings("static-method")
public ElkDisjointObjectPropertiesAxiom convert(
OWLDisjointObjectPropertiesAxiom owlDisjointObjectPropertiesAxiom) {
return new ElkDisjointObjectPropertiesAxiomWrap<OWLDisjointObjectPropertiesAxiom>(
owlDisjointObjectPropertiesAxiom);
}