protected OWLClassExpression getOWLClassOrRestriction(String termList) { StringTokenizer tok = new StringTokenizer(termList, " ", false); String id0 = null; String id1 = null; id0 = tok.nextToken(); if (tok.hasMoreTokens()) { id1 = tok.nextToken(); } if (id1 == null) { return getDataFactory().getOWLClass(getIRIFromOBOId(id0)); } else { IRI propertyIRI = getConsumer().getRelationIRIFromSymbolicIdOrOBOId(id0); OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(propertyIRI); OWLClass filler = getDataFactory().getOWLClass(getIRIFromOBOId(id1)); return getDataFactory().getOWLObjectSomeValuesFrom(prop, filler); } }
protected OWLClassExpression getOWLClassOrRestriction(String termList) { StringTokenizer tok = new StringTokenizer(termList, " ", false); String id0 = null; String id1 = null; id0 = tok.nextToken(); if (tok.hasMoreTokens()) { id1 = tok.nextToken(); } if (id1 == null) { return getDataFactory().getOWLClass(getIRIFromOBOId(id0)); } else { IRI propertyIRI = getConsumer().getRelationIRIFromSymbolicIdOrOBOId(id0); OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(propertyIRI); OWLClass filler = getDataFactory().getOWLClass(getIRIFromOBOId(id1)); return getDataFactory().getOWLObjectSomeValuesFrom(prop, filler); } }
public OWLEntity getCurrentEntity() { if (isTerm()) { return getCurrentClass(); } else if (isTypedef()) { // Sometimes, we can have symbolic names e.g. has_part. It's not really clear how to tell the difference IRI propertyIRI = getRelationIRIFromSymbolicIdOrOBOId(currentId); return getDataFactory().getOWLObjectProperty(propertyIRI); } else { return getDataFactory().getOWLNamedIndividual(getIRI(currentId)); } }
public OWLEntity getCurrentEntity() { if (isTerm()) { return getCurrentClass(); } else if (isTypedef()) { // Sometimes, we can have symbolic names e.g. has_part. It's not really clear how to tell the difference IRI propertyIRI = getRelationIRIFromSymbolicIdOrOBOId(currentId); return getDataFactory().getOWLObjectProperty(propertyIRI); } else { return getDataFactory().getOWLNamedIndividual(getIRI(currentId)); } }
public void handle(String currentId, String value, String qualifierBlock, String comment) { Matcher matcher = tagValuePattern.matcher(value); if(matcher.matches()) { IRI propIRI = getConsumer().getRelationIRIFromSymbolicIdOrOBOId(matcher.group(1)); IRI fillerIRI = getIRIFromOBOId(matcher.group(2)); // String modifier = matcher.group(3); OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(propIRI); OWLClass filler = getDataFactory().getOWLClass(fillerIRI); OWLClassExpression restriction = getDataFactory().getOWLObjectSomeValuesFrom(prop, filler); OWLClass subCls = getDataFactory().getOWLClass(getIRIFromOBOId(currentId)); applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLSubClassOfAxiom(subCls, restriction))); applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLDeclarationAxiom(prop))); } } }
@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { Matcher matcher = tagValuePattern.matcher(value); if(matcher.matches()) { IRI propIRI = getConsumer().getRelationIRIFromSymbolicIdOrOBOId(matcher.group(1)); IRI fillerIRI = getIRIFromOBOId(matcher.group(2)); OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(propIRI); OWLClass filler = getDataFactory().getOWLClass(fillerIRI); OWLClassExpression restriction = getDataFactory().getOWLObjectSomeValuesFrom(prop, filler); OWLClass subCls = getDataFactory().getOWLClass(getIRIFromOBOId(currentId)); applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLSubClassOfAxiom(subCls, restriction))); applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLDeclarationAxiom(prop))); } } }