return Optional.of(TYPE_FACTORY.getTermType(secondArgument)); return Optional.of(TYPE_FACTORY.getTermType(f.getFunctionSymbol().getType(0)));
public static Set<OWLDeclarationAxiom> extractDeclarationAxioms(OWLOntologyManager manager, Stream<? extends Function> targetAtoms) { OWLDataFactory dataFactory = manager.getOWLDataFactory(); Set<OWLDeclarationAxiom> declarationAxioms = new HashSet<>(); targetAtoms.forEach(f -> { IRI iri = IRI.create(f.getFunctionSymbol().getName()); final OWLEntity entity; if (f.getArity() == 1) { entity = dataFactory.getOWLClass(iri); } else { Predicate.COL_TYPE secondArgType = f.getFunctionSymbol().getType(1); if ((secondArgType != null) && secondArgType.equals(Predicate.COL_TYPE.OBJECT)) { entity = dataFactory.getOWLObjectProperty(iri); } else { entity = dataFactory.getOWLDataProperty(iri); } } declarationAxioms.add(dataFactory.getOWLDeclarationAxiom(entity)); }); return declarationAxioms; }
if (functionSymbol.getType(0) == UNSUPPORTED) { throw new RuntimeException("Unsupported type in the query: " + function);
if (functionSymbol.getType(0) == UNSUPPORTED) { throw new RuntimeException("Unsupported type in the query: " + function);