@Override public OWLClassExpression visit(OWLObjectAllValuesFrom ce) { OWLClassExpression filler = ce.getFiller().accept(this); if (negated) { return df.getOWLObjectSomeValuesFrom(ce.getProperty(), filler); } return df.getOWLObjectAllValuesFrom(ce.getProperty(), filler); }
public void visit(OWLObjectAllValuesFrom desc) { allValuesFrom.put(desc.getProperty().asOWLObjectProperty(), desc.getFiller().asOWLClass()); }
@Override public void visit(OWLObjectAllValuesFrom desc) { if (signature.contains(desc.getProperty().getNamedProperty())) { newDescription = df.getOWLObjectAllValuesFrom(desc.getProperty(), this.replaceBottom(desc.getFiller())); } else { newDescription = thing; } }
jj_consume_token(SUBCLASSOF); rhs = parseClassDescription(); if(lhs.isOWLThing()) { if(rhs instanceof OWLObjectAllValuesFrom) { {if (true) return factory.getOWLObjectPropertyRangeAxiom(restriction.getProperty(), restriction.getFiller());} if(restriction.getCardinality() == 1 && restriction.getFiller().isOWLThing()) { {if (true) return factory.getOWLFunctionalObjectPropertyAxiom(restriction.getProperty());} if(restriction.getFiller().isOWLThing()) { {if (true) return factory.getOWLObjectPropertyDomainAxiom(restriction.getProperty(), rhs);}
@Override public OWLClassExpression visit(OWLObjectAllValuesFrom ce) { OWLClassExpression filler = ce.getFiller(); OWLClassExpression shortendedFiller = filler.accept(this); if(shortendedFiller.isOWLThing()){// \forall r.\top \equiv \top return df.getOWLThing(); } else if(beautify && shortendedFiller.isOWLNothing()) {// \forall r.\bot to \neg \exists r.\top return df.getOWLObjectComplementOf(df.getOWLObjectSomeValuesFrom(ce.getProperty(), df.getOWLThing())); } else if(filler != shortendedFiller){ return df.getOWLObjectAllValuesFrom(ce.getProperty(), shortendedFiller); } return ce; }
if(!currDomain.isOWLThing() && !topARefinementsLength.containsKey(currDomain)){ topARefinementsLength.put(currDomain, 0); if(description.isOWLThing()) { if(!c.isOWLThing()){ refinements.add(df.getOWLObjectComplementOf(c)); OWLClassExpression filler = ((OWLObjectSomeValuesFrom) description).getFiller(); OWLClassExpression domain = role.isAnonymous() ? opDomains.get(role.getNamedProperty()) : opRanges.get(role); refinements.add(df.getOWLObjectSomeValuesFrom(role, c)); Set<OWLObjectProperty> moreSpecialRoles = objectPropertyHierarchy.getMoreSpecialRoles(role.getNamedProperty()); if(!description.isOWLThing() && !description.isOWLNothing() && !(description instanceof OWLObjectAllValuesFrom && ((OWLObjectAllValuesFrom)description).getFiller().isOWLNothing())) { for(OWLClassExpression child : ((OWLNaryBooleanClassExpression) description).getOperands()) { if(child instanceof OWLObjectAllValuesFrom) { OWLObjectPropertyExpression r1 = ((OWLObjectAllValuesFrom) c).getProperty(); OWLObjectPropertyExpression r2 = ((OWLObjectAllValuesFrom) child).getProperty(); if(r1.equals(r2)){ skip = true;
if (!objectAll.getFiller().equals(dataFactory.getOWLThing())) { OWLObjectPropertyExpression objectProperty=objectAll.getProperty(); if (m_automataByProperty.containsKey(objectProperty)) { OWLClassExpression replacement=replacedDescriptions.get(objectAll); if (replacement==null) { replacement=dataFactory.getOWLClass(IRI.create("internal:all#","a"+(firstReplacementIndex++))); if (objectAll.getFiller() instanceof OWLObjectComplementOf || objectAll.getFiller().equals(dataFactory.getOWLNothing())) replacement=replacement.getComplementNNF(); replacedDescriptions.put(objectAll,replacement); Automaton automaton=m_automataByProperty.get(replacement.getKey().getProperty()); boolean isOfNegativePolarity=(replacement.getValue() instanceof OWLObjectComplementOf); OWLClassExpression stateConcept=dataFactory.getOWLClass(IRI.create("internal:all#","a"+(firstReplacementIndex++))); if (isOfNegativePolarity) stateConcept=stateConcept.getComplementNNF(); statesToConcepts.put(state,stateConcept); OWLClassExpression fromStateConcept=statesToConcepts.get(transition.start()).getComplementNNF(); OWLClassExpression toStateConcept=statesToConcepts.get(transition.end()); if (transition.label()==null) OWLClassExpression filler=replacement.getKey().getFiller(); for (Object finalStateObject : automaton.terminals()) { OWLClassExpression finalStateConceptComplement=statesToConcepts.get(finalStateObject).getComplementNNF();
throws ReasoningMethodUnsupportedException { if (description.isOWLThing()) { return true; } else if (description.isOWLNothing()) { return false; } else if (!description.isAnonymous()) { return classInstancesPos.get(description.asOWLClass()).contains(individual); } else if (description instanceof OWLObjectComplementOf) { OWLClassExpression fillerConcept = ((OWLObjectSomeValuesFrom) description).getFiller(); if (property.isAnonymous()) {// \exists r^{-1}.C Map<OWLIndividual, SortedSet<OWLIndividual>> mapping = opPos.get(property.getNamedProperty()); OWLObjectPropertyExpression property = ((OWLObjectAllValuesFrom) description).getProperty(); OWLClassExpression fillerConcept = ((OWLObjectAllValuesFrom) description).getFiller(); if (property.isAnonymous()) {// \forall r^{-1}.C Map<OWLIndividual, SortedSet<OWLIndividual>> mapping = opPos.get(property.getNamedProperty()); boolean hasValue = hasTypeImpl(df.getOWLDataHasValue(property, value), individual);
OWLObjectPropertyExpression property = ((OWLObjectAllValuesFrom) description).getProperty(); OWLClassExpression filler = ((OWLObjectAllValuesFrom) description).getFiller(); property.isAnonymous() ? // \exists r^{-1}.{a} -> invert the mapping, i.e. get all objects that MapUtils.createSortedMultiMap(opPos.get(property.getNamedProperty())), TreeMultimap.create()).asMap() : opPos.get(property.getNamedProperty()); } else if (filler instanceof OWLDataIntersectionOf) { return ((OWLDataIntersectionOf) filler).getOperands().stream() .map(dr -> getIndividuals(df.getOWLDataSomeValuesFrom(property, dr))) .reduce((s1, s2) -> { s1.retainAll(s2); } else if (filler instanceof OWLDataUnionOf) { return ((OWLDataUnionOf) filler).getOperands().stream() .map(dr -> getIndividuals(df.getOWLDataSomeValuesFrom(property, dr))) .reduce((s1, s2) -> { s1.addAll(s2); return new TreeSet<>(Sets.difference( individuals, getIndividualsImpl(df.getOWLDataSomeValuesFrom( property, ((OWLDataComplementOf) filler).getDataRange()))));
private Set<OWLClassExpression> refine(OWLObjectAllValuesFrom ce, int maxLength) { Set<OWLClassExpression> refinements = new HashSet<>(); OWLObjectPropertyExpression role = ce.getProperty(); OWLClassExpression filler = ce.getFiller(); OWLClassExpression range = role.isAnonymous() ? opDomains.get(role.getNamedProperty()) : opRanges.get(role); refinements.add(df.getOWLObjectAllValuesFrom(role, c)); if(!filler.isOWLNothing() && !filler.isAnonymous() && tmp.size()==0) { refinements.add(df.getOWLObjectAllValuesFrom(role, df.getOWLNothing())); Set<OWLObjectProperty> subProperties = objectPropertyHierarchy.getMoreSpecialRoles(role.getNamedProperty());
public OWLClassExpression visit(OWLObjectAllValuesFrom d) { OWLClassExpression filler=getSimplified(d.getFiller()); if (filler.isOWLThing()) return m_factory.getOWLThing(); else return m_factory.getOWLObjectAllValuesFrom(d.getProperty().getSimplified(),filler); } public OWLClassExpression visit(OWLObjectHasValue d) {
@Override public OWLClassExpression visit(OWLObjectAllValuesFrom d) { OWLClassExpression filler=getNNF(d.getFiller()); return m_factory.getOWLObjectAllValuesFrom(d.getProperty(),filler); } @Override
String subject = variables.peek(); String objectVariable = mapping.newIndividualVariable(); OWLObjectPropertyExpression propertyExpression = ce.getProperty(); OWLObjectProperty predicate = propertyExpression.getNamedProperty(); OWLClassExpression filler = ce.getFiller(); if(filler.isOWLThing()) { sparql += triple(variables.peek(), mapping.newPropertyVariable(), objectVariable); } else { if(propertyExpression.isAnonymous()){ //property expression is inverse of a property sparql += triple(objectVariable, predicate, variables.peek()); } else { sparql += triple(subject, predicate, var); variables.push(var); filler.accept(this); variables.pop(); sparql += "} GROUP BY " + subject + "}";
@Override public void visit(OWLObjectAllValuesFrom desc) { //check if is the property we are looking for currentFoundProperty = desc.getProperty().asOWLObjectProperty().getIRI().getFragment(); if (null != propertiesMap.get(currentFoundProperty)) { this.state = PROPERTY_FOUND; desc.getFiller().accept(this); } }
newOperands.add(appendSomeValuesFrom(operand)); if(operand instanceof OWLObjectAllValuesFrom) { universallyQuantifiedProperties.add(((OWLObjectAllValuesFrom) operand).getProperty()); } else if(operand instanceof OWLObjectSomeValuesFrom) { existentiallyQuantifiedProperties.add(((OWLObjectSomeValuesFrom) operand).getProperty()); newOperands.add(df.getOWLObjectSomeValuesFrom(ope, df.getOWLThing())); return df.getOWLObjectIntersectionOf(newOperands); return ce.getNNF();
public void visit(OWLObjectAllValuesFrom exp) { //An OWLObjectAllValueFrom concept is locally positive iff the property is locally negative or the filler is locally positive exp.getFiller().accept(this); if (!isTop){ OWLObjectProperty prop = exp.getProperty().getNamedProperty(); if (!externalSignature.contains(prop)){ isTop = true; canMakeTop = true; solutions = new LinkedList<Set<OWLEntity>>(); } else{ if (!globalEntities.contains(prop)){ canMakeTop = true; Set<OWLEntity> aux = new HashSet<OWLEntity>(); aux.add(prop); solutions.add(aux); } } } }
public OWLClassExpression visit(OWLObjectAllValuesFrom d) { OWLClassExpression filler=getComplementNNF(d.getFiller()); return m_factory.getOWLObjectSomeValuesFrom(d.getProperty().getSimplified(),filler); } public OWLClassExpression visit(OWLObjectHasValue d) {
public OWLClassExpression visit(OWLObjectAllValuesFrom d) { OWLClassExpression filler=getNNF(d.getFiller()); return m_factory.getOWLObjectAllValuesFrom(d.getProperty().getSimplified(),filler); } public OWLClassExpression visit(OWLObjectHasValue d) {
@Override public OWLClassExpression visit(OWLObjectAllValuesFrom d) { OWLClassExpression filler=getComplementNNF(d.getFiller()); return m_factory.getOWLObjectSomeValuesFrom(d.getProperty(),filler); } @Override
@Override public Set<OWLClassExpression> visit(OWLObjectAllValuesFrom ce) { Set<OWLClassExpression> result = new HashSet<>(); result.add(ce); result.add(dataFactory.getOWLObjectAllValuesFrom(ce.getProperty(), dataFactory.getOWLNothing())); return result; }