@Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); } }
/** * Determines if this annotation is an annotation used to deprecate an IRI. This is the case if the annotation * property has an IRI of <code>owl:deprecated</code> and the value of the annotation is <code>"true"^^xsd:boolean</code> * @return <code>true</code> if this annotation is an annotation that can be used to deprecate an IRI, otherwise * <code>false</code>. */ @Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); }
@Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); } }
@Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); } }
@Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); } }
/** * Determines if this annotation is an annotation used to deprecate an IRI. * This is the case if the annotation property has an IRI of * {@code owl:deprecated} and the value of the annotation is * {@code "true"^^xsd:boolean} * * @return {@code true} if this annotation is an annotation that can be used * to deprecate an IRI, otherwise {@code false}. */ @Override public boolean isDeprecatedIRIAnnotation() { return property.isDeprecated() && value instanceof OWLLiteral && ((OWLLiteral) value).isBoolean() && ((OWLLiteral) value).parseBoolean(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (obj instanceof OWLLiteralImplBoolean) { OWLLiteralImplBoolean other = (OWLLiteralImplBoolean) obj; return literal == other.literal; } if (obj instanceof OWLLiteral) { return ((OWLLiteral) obj).isBoolean() && literal == ((OWLLiteral) obj).parseBoolean(); } return false; }
@Override public boolean matches(@Nonnull OWLEntity value) { Multimap<OWLAnnotationProperty, Boolean> map = HashMultimap.create(10, 2); for (OWLAnnotationAssertionAxiom ax : axioms.getAnnotationAssertionAxioms(value.getIRI()).collect(toList())) { if (ax.getValue() instanceof OWLLiteral) { OWLLiteral literal = (OWLLiteral) ax.getValue(); if (literal.isBoolean() && isInBooleanLexicalSpace(literal)) { if (map.put(ax.getProperty(), normalise(literal))) { if (map.get(ax.getProperty()).size() > 1) { return true; } } } } } return false; }
@Override public Collection<Object> getData(IProperty property) { List<Object> ret = new ArrayList<>(); for (OWLLiteral dat : individual.getDataPropertyValues(((Property)property)._owl.asOWLDataProperty(), ontology)) { if (dat.isBoolean()) { ret.add(dat.parseBoolean()); } else if (dat.isBoolean()) { ret.add(dat.parseBoolean()); } else if (dat.isDouble()) { ret.add(dat.parseDouble()); } else if (dat.isFloat()) { ret.add(dat.parseFloat()); } else if (dat.isInteger()) { ret.add(dat.parseFloat()); } else { ret.add(dat.getLiteral()); } } return ret; }
public static boolean isDeprecated(@Nonnull IRI iri, @Nonnull Collection<OWLOntology> ontologies) { for (OWLOntology ontology : ontologies) { for (OWLAnnotationAssertionAxiom assertion : ontology.getAnnotationAssertionAxioms(iri)) { if (!assertion.getProperty().isDeprecated()) { continue; } if (!(assertion.getValue() instanceof OWLLiteral)) { continue; } OWLLiteral value = (OWLLiteral) assertion.getValue(); if (!value.isBoolean()) { continue; } if (value.parseBoolean()) { return true; } } } return false; } }
public static Object literal2obj(OWLAnnotationValue l) { if (l instanceof OWLLiteral) { if (((OWLLiteral) l).isBoolean()) return ((OWLLiteral) l).parseBoolean(); else if (((OWLLiteral) l).isInteger()) return ((OWLLiteral) l).parseInteger(); else if (((OWLLiteral) l).isFloat()) return ((OWLLiteral) l).parseFloat(); else if (((OWLLiteral) l).isDouble()) return ((OWLLiteral) l).parseDouble(); else { return ((OWLLiteral)l).getLiteral(); } } else if (l instanceof IRI) { return ((IRI)l).toURI().toString(); } return l.toString(); }
@Override public void visit(SWRLLiteralArgument node) { OWLLiteral literal=node.getLiteral(); if (literal.isBoolean()) terms.add(fac.getBooleanConstant(literal.parseBoolean())); else if(literal.hasLang()) terms.add(fac.getConstantLiteral(literal.getLiteral(), literal.getLang())); else if (literal.isDouble()) terms.add(fac.getConstantLiteral(literal.getLiteral(), Predicate.COL_TYPE.DOUBLE)); else if (literal.isFloat()) terms.add(fac.getConstantLiteral(literal.getLiteral(), Predicate.COL_TYPE.DECIMAL)); else if (literal.isInteger()) terms.add(fac.getConstantLiteral(literal.getLiteral(), Predicate.COL_TYPE.INTEGER)); else fac.getConstantLiteral(literal.getLiteral()); }
@Override public void visit(SWRLLiteralArgument node) { OWLLiteral literal=node.getLiteral(); if (literal.isBoolean()) terms.add(termFactory.getBooleanConstant(literal.parseBoolean())); else if(literal.hasLang()) terms.add(termFactory.getConstantLiteral(literal.getLiteral(), literal.getLang())); else if (literal.isDouble()) terms.add(termFactory.getConstantLiteral(literal.getLiteral(), typeFactory.getXsdDoubleDatatype())); else if (literal.isFloat()) terms.add(termFactory.getConstantLiteral(literal.getLiteral(), typeFactory.getXsdDecimalDatatype())); else if (literal.isInteger()) terms.add(termFactory.getConstantLiteral(literal.getLiteral(), typeFactory.getXsdIntegerDatatype())); else termFactory.getConstantLiteral(literal.getLiteral()); }
private boolean getIsRuleEnabled(@NonNull SWRLRule owlapiRule) { OWLAnnotationProperty enabledAnnotationProperty = getOWLDataFactory() .getOWLAnnotationProperty(IRI.create("http://swrl.stanford.edu/ontologies/3.3/swrla.owl#isRuleEnabled")); for (OWLAnnotation annotation : owlapiRule.getAnnotations(enabledAnnotationProperty)) { if (annotation.getValue() instanceof OWLLiteral) { OWLLiteral literal = (OWLLiteral)annotation.getValue(); if (literal.isBoolean()) return literal.parseBoolean(); } } return true; }
public static boolean isDeprecated(OWLEntity o, Collection<OWLOntology> ontologies) { for (OWLOntology ontology : ontologies) { for (OWLAnnotationAssertionAxiom assertion : ontology.getAnnotationAssertionAxioms(o.getIRI())) { if (!assertion.getProperty().isDeprecated()) { continue; } if (!(assertion.getValue() instanceof OWLLiteral)) { continue; } OWLLiteral value = (OWLLiteral) assertion.getValue(); if (!value.isBoolean()) { continue; } if (value.parseBoolean()) { return true; } } } return false; } }
public boolean isDeprecated(OWLEntity e, DifferencePosition position) { OWLOntology ontology = position.getOntology(engine.getOwlDiffMap()); for (OWLOntology ont : ontology.getImportsClosure()) { for (OWLAnnotation annotation : e.getAnnotations(ont, engine.getOWLDataFactory().getOWLDeprecated())) { if (!(annotation.getValue() instanceof OWLLiteral)) { continue; } OWLLiteral value = (OWLLiteral) annotation.getValue(); if (!value.isBoolean()) { continue; } if (value.parseBoolean()) { return true; } } } return false; }
public boolean isDeprecated(OWLEntity e, DifferencePosition position) { OWLOntology ontology = position.getOntology(engine.getOwlDiffMap()); OWLAnnotationProperty deprecated = engine.getOWLDataFactory().getOWLDeprecated(); for (OWLOntology ont : ontology.getImportsClosure()) { for (OWLAnnotation annotation : EntitySearcher.getAnnotations(e, ont, deprecated)) { if (!(annotation.getValue() instanceof OWLLiteral)) { continue; } OWLLiteral value = (OWLLiteral) annotation.getValue(); if (!value.isBoolean()) { continue; } if (value.parseBoolean()) { return true; } } } return false; }
public void visit(OWLLiteral owlLiteral) { if (owlLiteral.isBoolean()) { builder.append(Boolean.toString(owlLiteral.parseBoolean())); } else if (owlLiteral.isDouble()) { builder.append(owlLiteral.parseDouble()); } else if (owlLiteral.isFloat()) { builder.append(owlLiteral.parseFloat()); } else if (owlLiteral.isInteger()) { builder.append(owlLiteral.parseInteger()); } else { builder.append("\""); builder.append(owlLiteral.getLiteral()); builder.append("\"^^"); owlLiteral.getDatatype().accept(this); } }
public void visit(OWLLiteral owlLiteral) { if (owlLiteral.isBoolean()) { builder.append(Boolean.toString(owlLiteral.parseBoolean())); } else if (owlLiteral.isDouble()) { builder.append(owlLiteral.parseDouble()); } else if (owlLiteral.isFloat()) { builder.append(owlLiteral.parseFloat()); } else if (owlLiteral.isInteger()) { builder.append(owlLiteral.parseInteger()); } else { builder.append("\""); builder.append(owlLiteral.getLiteral()); builder.append("\"^^"); owlLiteral.getDatatype().accept(this); } }
public void visit(@Nonnull OWLLiteral owlLiteral) { if (owlLiteral.isBoolean()) { builder.append(owlLiteral.getLiteral()); } else if (owlLiteral.isDouble()) { builder.append(owlLiteral.getLiteral()); } else if (owlLiteral.isFloat()) { builder.append(owlLiteral.getLiteral()); } else if (owlLiteral.isInteger()) { builder.append(owlLiteral.getLiteral()); } else { builder.append("\""); builder.append(owlLiteral.getLiteral()); builder.append("\"^^"); owlLiteral.getDatatype().accept(this); } }