本文整理汇总了Java中org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom类的典型用法代码示例。如果您正苦于以下问题:Java OWLNegativeObjectPropertyAssertionAxiom类的具体用法?Java OWLNegativeObjectPropertyAssertionAxiom怎么用?Java OWLNegativeObjectPropertyAssertionAxiom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OWLNegativeObjectPropertyAssertionAxiom类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLNegativeObjectPropertyAssertionAxiom类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
/**
*
* @see org.semanticweb.owlapi.model.OWLAxiomVisitor#visit(org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom)
*/
public void visit(OWLNegativeObjectPropertyAssertionAxiom negObjPropertyAssertion) {
//assert !negObjPropertyAssertion.getProperty().isAnonymous();
OWLObjectProperty property = negObjPropertyAssertion.getProperty().asOWLObjectProperty();
String propertyName = mapper.getPredicateName(property);
OWLNamedIndividual subject = negObjPropertyAssertion.getSubject().asOWLNamedIndividual();
OWLNamedIndividual object = negObjPropertyAssertion.getObject().asOWLNamedIndividual();
String subjectName = mapper.getConstantName(subject);
String objectName = mapper.getConstantName(object);
writer.print("not_");
writer.print(propertyName);
writer.print(ASP2CoreSymbols.BRACKET_OPEN);
writer.print(subjectName);
writer.print(ASP2CoreSymbols.ARG_SEPERATOR);
writer.print(objectName);
writer.print(ASP2CoreSymbols.BRACKET_CLOSE);
writer.print(ASP2CoreSymbols.EOR);
}
示例2: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
/**
*
* @see org.semanticweb.owlapi.model.OWLAxiomVisitor#visit(org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom)
*/
public void visit(OWLNegativeObjectPropertyAssertionAxiom negObjPropertyAssertion) {
//assert !negObjPropertyAssertion.getProperty().isAnonymous();
OWLObjectProperty property = negObjPropertyAssertion.getProperty().asOWLObjectProperty();
String propertyName = mapper.getPredicateName(property);
OWLNamedIndividual subject = negObjPropertyAssertion.getSubject().asOWLNamedIndividual();
OWLNamedIndividual object = negObjPropertyAssertion.getObject().asOWLNamedIndividual();
String subjectName = mapper.getConstantName(subject);
String objectName = mapper.getConstantName(object);
writer.print(ASP2CoreSymbols.CLASSICAL_NEGATION);
writer.print(propertyName);
writer.print(ASP2CoreSymbols.BRACKET_OPEN);
writer.print(subjectName);
writer.print(ASP2CoreSymbols.ARG_SEPERATOR);
writer.print(objectName);
writer.print(ASP2CoreSymbols.BRACKET_CLOSE);
writer.print(ASP2CoreSymbols.EOR);
}
示例3: rewriteNegativeObjectPropertyAssertions
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
public int rewriteNegativeObjectPropertyAssertions(OWLDataFactory factory,OWLAxioms axioms,int replacementIndex) {
// now object property inclusion manager added all non-simple properties to axioms.m_complexObjectPropertyExpressions
// now that we know which roles are non-simple, we can decide which negative object property assertions have to be
// expressed as concept assertions so that transitivity rewriting applies properly. All new concepts for the concept
// assertions must be normalised, because we are done with the normal normalisation phase.
Set<OWLIndividualAxiom> redundantFacts=new HashSet<OWLIndividualAxiom>();
Set<OWLIndividualAxiom> additionalFacts=new HashSet<OWLIndividualAxiom>();
for (OWLIndividualAxiom axiom : axioms.m_facts) {
if (axiom instanceof OWLNegativeObjectPropertyAssertionAxiom) {
OWLNegativeObjectPropertyAssertionAxiom negAssertion=(OWLNegativeObjectPropertyAssertionAxiom)axiom;
OWLObjectPropertyExpression prop=negAssertion.getProperty().getSimplified();
if (axioms.m_complexObjectPropertyExpressions.contains(prop)) {
// turn not op(a b) into
// C(a) and not C or forall op not{b}
OWLIndividual individual=negAssertion.getObject();
// neg. op assertions cannot contain anonymous individuals
OWLClass individualConcept=factory.getOWLClass(IRI.create("internal:nom#"+individual.asOWLNamedIndividual().getIRI().toString()));
OWLClassExpression notIndividualConcept=factory.getOWLObjectComplementOf(individualConcept);
OWLClassExpression allNotIndividualConcept=factory.getOWLObjectAllValuesFrom(prop,notIndividualConcept);
OWLClassExpression definition=factory.getOWLClass(IRI.create("internal:def#"+(replacementIndex++)));
axioms.m_conceptInclusions.add(new OWLClassExpression[] { factory.getOWLObjectComplementOf(definition), allNotIndividualConcept });
additionalFacts.add(factory.getOWLClassAssertionAxiom(definition,negAssertion.getSubject()));
additionalFacts.add(factory.getOWLClassAssertionAxiom(individualConcept,individual));
redundantFacts.add(negAssertion);
}
}
}
axioms.m_facts.addAll(additionalFacts);
axioms.m_facts.removeAll(redundantFacts);
return replacementIndex;
}
示例4: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
public Boolean visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
// see OWL 2 Syntax, Sec 11.2
// No axiom in Ax of the following form contains anonymous individuals:
// SameIndividual, DifferentIndividuals, NegativeObjectPropertyAssertion, and NegativeDataPropertyAssertion.
if (axiom.getSubject().isAnonymous()||axiom.getObject().isAnonymous()) {
throw new IllegalArgumentException("NegativeObjectPropertyAssertion axioms are not allowed to be used "+"with anonymous individuals (see OWL 2 Syntax Sec 11.2) but the axiom "+axiom+" cotains an anonymous subject or object. ");
}
OWLClassExpression hasValue=factory.getOWLObjectHasValue(axiom.getProperty(),axiom.getObject());
OWLClassExpression doesNotHaveValue=factory.getOWLObjectComplementOf(hasValue);
return reasoner.hasType(axiom.getSubject().asOWLNamedIndividual(),doesNotHaveValue,false);
}
示例5: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
@Override
public OWLNegativeObjectPropertyAssertionAxiom visit(
ElkNegativeObjectPropertyAssertionAxiom axiom) {
return owlFactory_.getOWLNegativeObjectPropertyAssertionAxiom(
convert(axiom.getProperty()), convert(axiom.getSubject()),
convert(axiom.getObject()));
}
示例6: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
@Override
public T visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
throw new IllegalArgumentException(
OWLNegativeObjectPropertyAssertionAxiom.class.getSimpleName()
+ " cannot be converted to "
+ getTargetClass().getSimpleName());
}
示例7: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
@Override
public Set<ComplexIntegerAxiom> visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
Objects.requireNonNull(axiom);
IntegerObjectPropertyExpression propertyExpr = translateObjectPropertyExpression(axiom.getProperty());
Integer subjectId = translateIndividual(axiom.getSubject());
Integer objectId = translateIndividual(axiom.getObject());
ComplexIntegerAxiom ret = getAxiomFactory().createNegativeObjectPropertyAssertionAxiom(propertyExpr, subjectId,
objectId, translateAnnotations(axiom.getAnnotations()));
return Collections.singleton(ret);
}
示例8: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
@Override
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
hashCode = primes[22];
hashCode = hashCode * MULT + axiom.getSubject().hashCode();
hashCode = hashCode * MULT + axiom.getProperty().hashCode();
hashCode = hashCode * MULT + axiom.getObject().hashCode();
hashCode = hashCode * MULT + axiom.getAnnotations().hashCode();
}
示例9: getAxiomWithoutAnnotations
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
@Override
public OWLNegativeObjectPropertyAssertionAxiom getAxiomWithoutAnnotations() {
if (!isAnnotated()) {
return this;
}
return new OWLNegativeObjectPropertyAssertionAxiomImpl(getSubject(),
getProperty(), getObject(), NO_ANNOTATIONS);
}
示例10: equals
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
return obj instanceof OWLNegativeObjectPropertyAssertionAxiom;
}
示例11: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
@Override
public void visit(@Nonnull OWLNegativeObjectPropertyAssertionAxiom axiom) {
axiom.getSubject().accept(this);
axiom.getProperty().accept(this);
axiom.getObject().accept(this);
processAxiomAnnotations(axiom);
}
示例12: readAxiom
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
@Override
protected OWLNegativeObjectPropertyAssertionAxiom readAxiom(BinaryOWLInputStream inputStream, Set<OWLAnnotation> annotations) throws IOException, BinaryOWLParseException {
OWLObjectPropertyExpression property = inputStream.readOWLObject();
OWLIndividual subject = inputStream.readOWLObject();
OWLIndividual object = inputStream.readOWLObject();
return inputStream.getDataFactory().getOWLNegativeObjectPropertyAssertionAxiom(property, subject, object, annotations);
}
开发者ID:matthewhorridge,项目名称:binaryowl,代码行数:8,代码来源:OWLNegativeObjectPropertyAssertionAxiomSerializer.java
示例13: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
notSupported(axiom);
}
示例14: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
public void visit(OWLNegativeObjectPropertyAssertionAxiom object) {
visitProperty(object.getProperty());
}
示例15: visit
import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom; //导入依赖的package包/类
public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
if (axiom.containsAnonymousIndividuals())
throw new IllegalArgumentException("The axiom "+axiom+" contains anonymous individuals, which is not allowed in OWL 2 DL. ");
addFact(m_factory.getOWLNegativeObjectPropertyAssertionAxiom(axiom.getProperty().getSimplified(),axiom.getSubject(),axiom.getObject()));
m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(axiom.getProperty().getNamedProperty());
}