private static Statement createStatement(AnnotationAssertion assertion) { Constant constant = assertion.getValue(); if (constant instanceof ValueConstant) { return fact.createStatement(getResource(assertion.getSubject()), createURI(assertion.getProperty().getIRI().getIRIString()), getLiteral((ValueConstant) constant)); } else if (constant instanceof ObjectConstant) { return fact.createStatement(getResource(assertion.getSubject()), createURI(assertion.getProperty().getIRI().getIRIString()), getResource((ObjectConstant) constant)); } else { throw new RuntimeException("Unsupported constant for an annotation property!" + constant); } }
private static Statement createStatement(AnnotationAssertion assertion) { Constant constant = assertion.getValue(); if (constant instanceof ValueConstant) { return fact.createStatement(getResource(assertion.getSubject()), createURI(assertion.getProperty().getPredicate().getName()), getLiteral((ValueConstant) constant)); } else if (constant instanceof ObjectConstant) { return fact.createStatement(getResource(assertion.getSubject()), createURI(assertion.getProperty().getPredicate().getName()), getResource((ObjectConstant) constant)); } else { throw new RuntimeException("Unsupported constant for an annotation property!" + constant); } }
public OWLAnnotationAssertionAxiom translate(AnnotationAssertion opa) { IRI roleIRI = IRI.create(opa.getProperty().getName()); OWLAnnotationProperty property = dataFactory.getOWLAnnotationProperty(roleIRI); OWLAnnotationSubject subject = translateAnnotationSubject(opa.getSubject()); OWLAnnotationValue object = translateAnnotationValue(opa.getValue()); return dataFactory.getOWLAnnotationAssertionAxiom(property, subject, object); }
IRIConstant s = (IRIConstant) aa.getSubject(); IRI propertyIRI = aa.getProperty().getIRI();
URIConstant s = (URIConstant) aa.getSubject(); Predicate p = aa.getProperty().getPredicate();