protected Node getFirst(final Node list) { return getObject(list, RDF.first.asNode()); }
protected boolean isRestriction(final Node node) { return getObject(node, OWL.onProperty.asNode()) != null; }
protected Node getRest(final Node list) { return getObject(list, RDF.rest.asNode()); }
protected Node getFirst(final Node list) { return getObject(list, RDF.first.asNode()); }
protected Node getRest(final Node list) { return getObject(list, RDF.rest.asNode()); }
protected Node getRest(final Node list) { return getObject(list, RDF.rest.asNode()); }
protected boolean isRestriction(final Node node) { return getObject(node, OWL.onProperty.asNode()) != null; }
protected Node getFirst(final Node list) { return getObject(list, RDF.first.asNode()); }
protected boolean isRestriction(final Node node) { return getObject(node, OWL.onProperty.asNode()) != null; }
private List<AtomDObject> parseArgumentList(final Node argumentListParam) { Node argumentList = argumentListParam; final List<AtomDObject> arguments = new ArrayList<>(); while (argumentList != null && !argumentList.equals(RDF.nil.asNode())) { final Node argumentNode = getObject(argumentList, RDF.first.asNode()); if (argumentNode == null) addUnsupportedFeature("Term in _list not found " + RDF.first); else { arguments.add(createRuleDObject(argumentNode)); argumentList = getObject(argumentList, RDF.rest.asNode()); } } return arguments; }
private List<AtomDObject> parseArgumentList(final Node argumentListParam) { Node argumentList = argumentListParam; final List<AtomDObject> arguments = new ArrayList<>(); while (argumentList != null && !argumentList.equals(RDF.nil.asNode())) { final Node argumentNode = getObject(argumentList, RDF.first.asNode()); if (argumentNode == null) addUnsupportedFeature("Term in _list not found " + RDF.first); else { arguments.add(createRuleDObject(argumentNode)); argumentList = getObject(argumentList, RDF.rest.asNode()); } } return arguments; }
private List<AtomDObject> parseArgumentList(final Node argumentListParam) { Node argumentList = argumentListParam; final List<AtomDObject> arguments = new ArrayList<>(); while (argumentList != null && !argumentList.equals(RDF.nil.asNode())) { final Node argumentNode = getObject(argumentList, RDF.first.asNode()); if (argumentNode == null) addUnsupportedFeature("Term in _list not found " + RDF.first); else { arguments.add(createRuleDObject(argumentNode)); argumentList = getObject(argumentList, RDF.rest.asNode()); } } return arguments; }
private void defineRule(final Node node) { final List<RuleAtom> head = parseAtomList(getObject(node, SWRL.head.asNode())); final List<RuleAtom> body = parseAtomList(getObject(node, SWRL.body.asNode())); if (head == null || body == null) { String whichPart = "head and body"; if (head != null) whichPart = "body"; else if (body != null) whichPart = "head"; addUnsupportedFeature("Ignoring SWRL rule (unsupported " + whichPart + "): " + node); return; } final ATermAppl name = JenaUtils.makeATerm(node); final Rule rule = new Rule(name, head, body); _kb.addRule(rule); }
private void defineRule(final Node node) { final List<RuleAtom> head = parseAtomList(getObject(node, SWRL.head.asNode())); final List<RuleAtom> body = parseAtomList(getObject(node, SWRL.body.asNode())); if (head == null || body == null) { String whichPart = "head and body"; if (head != null) whichPart = "body"; else if (body != null) whichPart = "head"; addUnsupportedFeature("Ignoring SWRL rule (unsupported " + whichPart + "): " + node); return; } final ATermAppl name = JenaUtils.makeATerm(node); final Rule rule = new Rule(name, head, body); _kb.addRule(rule); }
private void defineRule(final Node node) { final List<RuleAtom> head = parseAtomList(getObject(node, SWRL.head.asNode())); final List<RuleAtom> body = parseAtomList(getObject(node, SWRL.body.asNode())); if (head == null || body == null) { String whichPart = "head and body"; if (head != null) whichPart = "body"; else if (body != null) whichPart = "head"; addUnsupportedFeature("Ignoring SWRL rule (unsupported " + whichPart + "): " + node); return; } final ATermAppl name = JenaUtils.makeATerm(node); final Rule rule = new Rule(name, head, body); _kb.addRule(rule); }
private ATermAppl parseDataRangeLegacy(final Node s, final Node definition) { if (!definition.isURI()) { addUnsupportedFeature("Invalid datatype definition, _expected URI but found " + s); return ATermUtils.BOTTOM_LIT; } final ATermAppl baseDatatype = ATermUtils.makeTermAppl(definition.getURI()); final Property[] datatypeFacets = new Property[] { OWL2.minInclusive, OWL2.maxInclusive, OWL2.minExclusive, OWL2.maxExclusive, OWL2.totalDigits, OWL2.fractionDigits, OWL2.pattern }; final List<ATermAppl> restrictions = new ArrayList<>(); for (final Property datatypeFacet : datatypeFacets) { final Node facetValue = getObject(s, datatypeFacet.asNode()); if (facetValue != null) { final ATermAppl restriction = ATermUtils.makeFacetRestriction(ATermUtils.makeTermAppl(datatypeFacet.getURI()), JenaUtils.makeATerm(facetValue)); restrictions.add(restriction); } } if (restrictions.isEmpty()) { addUnsupportedFeature("A _data range is defined without XSD facet restrictions " + s); return ATermUtils.BOTTOM_LIT; } else return ATermUtils.makeRestrictedDatatype(baseDatatype, restrictions.toArray(new ATermAppl[restrictions.size()])); }
private ATermAppl parseDataRangeLegacy(final Node s, final Node definition) { if (!definition.isURI()) { addUnsupportedFeature("Invalid datatype definition, _expected URI but found " + s); return ATermUtils.BOTTOM_LIT; } final ATermAppl baseDatatype = ATermUtils.makeTermAppl(definition.getURI()); final Property[] datatypeFacets = new Property[] { OWL2.minInclusive, OWL2.maxInclusive, OWL2.minExclusive, OWL2.maxExclusive, OWL2.totalDigits, OWL2.fractionDigits, OWL2.pattern }; final List<ATermAppl> restrictions = new ArrayList<>(); for (final Property datatypeFacet : datatypeFacets) { final Node facetValue = getObject(s, datatypeFacet.asNode()); if (facetValue != null) { final ATermAppl restriction = ATermUtils.makeFacetRestriction(ATermUtils.makeTermAppl(datatypeFacet.getURI()), JenaUtils.makeATerm(facetValue)); restrictions.add(restriction); } } if (restrictions.isEmpty()) { addUnsupportedFeature("A _data range is defined without XSD facet restrictions " + s); return ATermUtils.BOTTOM_LIT; } else return ATermUtils.makeRestrictedDatatype(baseDatatype, restrictions.toArray(new ATermAppl[restrictions.size()])); }
private ATermAppl parseDataRangeLegacy(final Node s, final Node definition) { if (!definition.isURI()) { addUnsupportedFeature("Invalid datatype definition, _expected URI but found " + s); return ATermUtils.BOTTOM_LIT; } final ATermAppl baseDatatype = ATermUtils.makeTermAppl(definition.getURI()); final Property[] datatypeFacets = new Property[] { OWL2.minInclusive, OWL2.maxInclusive, OWL2.minExclusive, OWL2.maxExclusive, OWL2.totalDigits, OWL2.fractionDigits, OWL2.pattern }; final List<ATermAppl> restrictions = new ArrayList<>(); for (final Property datatypeFacet : datatypeFacets) { final Node facetValue = getObject(s, datatypeFacet.asNode()); if (facetValue != null) { final ATermAppl restriction = ATermUtils.makeFacetRestriction(ATermUtils.makeTermAppl(datatypeFacet.getURI()), JenaUtils.makeATerm(facetValue)); restrictions.add(restriction); } } if (restrictions.isEmpty()) { addUnsupportedFeature("A _data range is defined without XSD facet restrictions " + s); return ATermUtils.BOTTOM_LIT; } else return ATermUtils.makeRestrictedDatatype(baseDatatype, restrictions.toArray(new ATermAppl[restrictions.size()])); }
final Node restrictionList = getObject(s, OWL2.withRestrictions.asNode()); final RDFListIterator i = new RDFListIterator(restrictionList); while (i.hasNext()) for (final Property datatypeFacet : datatypeFacets) final Node facetValue = getObject(restrictionNode, datatypeFacet.asNode()); if (facetValue != null)
final Node restrictionList = getObject(s, OWL2.withRestrictions.asNode()); final RDFListIterator i = new RDFListIterator(restrictionList); while (i.hasNext()) for (final Property datatypeFacet : datatypeFacets) final Node facetValue = getObject(restrictionNode, datatypeFacet.asNode()); if (facetValue != null)