@Nonnull @Override public Set<OWLAxiom> visit(OWLNamedIndividual subject) { Set<OWLAxiom> result = new HashSet<>(); for (OWLClassExpression ce : classExpressions) { result.add(df.getOWLClassAssertionAxiom(ce, subject)); } return result; } });
@Nonnull @Override public Optional<OWLAxiom> visit(@Nonnull OWLNamedIndividual individual) { return strategy.getDeprecatedIndividualParentClassIri() .map(parent -> dataFactory.getOWLClassAssertionAxiom(dataFactory.getOWLClass(parent), individual)); }
@Override public void handleTriple(IRI s, IRI p, IRI o) { OWLIndividual ind = df.getOWLNamedIndividual(s); OWLClass skosConcept = df.getOWLClass(o); add(df.getOWLClassAssertionAxiom(skosConcept, ind)); } }
@Override public void handleTriple(IRI s, IRI p, IRI o) { if (BUILT_IN_VOCABULARY_IRIS.contains(o) && !o.isThing()) { // Can't have instance of built in vocabulary! // Shall we throw an exception here? LOGGER.info("Individual of builtin type {}", o); } add(df.getOWLClassAssertionAxiom(ce(o), ind(s), anns())); consume(s, p, o); } }
public boolean dropObjects(List<OWLObject> objects) { List<OWLOntologyChange> changes = new ArrayList<>(); for (OWLObject obj : objects) { if (obj instanceof OWLIndividual) { OWLIndividual ind = (OWLIndividual) obj; OWLAxiom ax = getOWLDataFactory().getOWLClassAssertionAxiom(getRootObject(), ind); changes.add(new AddAxiom(getOWLModelManager().getActiveOntology(), ax)); } } getOWLModelManager().applyChanges(changes); return true; }
private void handleAdd(OWLObject child, OWLObject toParent) { if (child instanceof OWLNamedIndividual){ OWLNamedIndividual ind = (OWLNamedIndividual)child; List<OWLOntologyChange> changes = new ArrayList<>(); if (toParent != null && toParent instanceof OWLClass){ OWLClass to = (OWLClass)toParent; OWLClassAssertionAxiom ax = getOWLModelManager().getOWLDataFactory().getOWLClassAssertionAxiom(to, ind); changes.add(new AddAxiom(getOWLModelManager().getActiveOntology(), ax)); } getOWLModelManager().applyChanges(changes); } }
@Override public OWLClassAssertionAxiom visit(OWLClassAssertionAxiom axiom) { return df .getOWLClassAssertionAxiom(get(axiom.getClassExpression()), get(axiom.getIndividual()), anns(axiom)); }
final public OWLAxiom Instance() throws ParseException {OWLIndividual ind; OWLClassExpression type; jj_consume_token(OPENPAR); jj_consume_token(INSTANCE); ind = IndividualName(); type = ConceptExpression(); jj_consume_token(CLOSEPAR); return df.getOWLClassAssertionAxiom(type, ind); }
@Override public OWLClassAssertionAxiom visit(OWLClassAssertionAxiom ax) { return df.getOWLClassAssertionAxiom(t(ax.getClassExpression()), t(ax.getIndividual()), a(ax)); }
final public OWLAxiom Instance() throws ParseException {OWLIndividual ind; OWLClassExpression type; jj_consume_token(OPENPAR); jj_consume_token(INSTANCE); ind = IndividualName(); type = ConceptExpression(); jj_consume_token(CLOSEPAR); return df.getOWLClassAssertionAxiom(type, ind); }
@Override public OWLClassAssertionAxiom visit(OWLClassAssertionAxiom axiom) { return df .getOWLClassAssertionAxiom(get(axiom.getClassExpression()), get(axiom.getIndividual()), anns(axiom)); }
protected List<OWLOntologyChange> dofurtherCreateSteps(OWLIndividual newIndividual) { OWLClass cls = getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass(); if (cls != null && !cls.isOWLThing()) { OWLAxiom typeAxiom = getOWLModelManager().getOWLDataFactory().getOWLClassAssertionAxiom(cls, newIndividual); OWLOntologyChange change = new AddAxiom(getOWLModelManager().getActiveOntology(), typeAxiom); return Collections.singletonList(change); } return new ArrayList<>(); }
@Override public void visit(OWLClassAssertionAxiom ax) { obj = df.getOWLClassAssertionAxiom(dup(ax.getClassExpression()), dup(ax.getIndividual()), anns(ax)); }
@Override public OWLAxiom visit(OWLClassAssertionAxiom axiom) { if (axiom.getClassExpression().isAnonymous()) { return df.getOWLClassAssertionAxiom(axiom.getClassExpression().accept(classVisitor), axiom.getIndividual()); } return axiom; }
final public void Instance() throws ParseException, KRSS2OWLParserException {OWLIndividual ind; OWLClassExpression type; jj_consume_token(OPENPAR); jj_consume_token(INSTANCE); ind = IndividualName(); type = ConceptExpression(); jj_consume_token(CLOSEPAR); addAxiom( df.getOWLClassAssertionAxiom(type, ind)); }
final public OWLIndividualAxiom ClassAssertion() throws ParseException {OWLIndividual ind; OWLClassExpression desc; Set<OWLAnnotation> axiomAnnos; jj_consume_token(CLASSASSERTION); jj_consume_token(OPENPAR); axiomAnnos = AxiomAnnotationSet(); desc = ClassExpression(); ind = Individual(); jj_consume_token(CLOSEPAR); return df.getOWLClassAssertionAxiom(desc, ind, axiomAnnos); }
private OWLAxiom parseAxiomWithIndividualStart() { OWLIndividual ind = parseIndividual(); String kw = consumeToken(); if (TYPE.matches(kw)) { OWLClassExpression type = parseClassExpression(); return df.getOWLClassAssertionAxiom(type, ind); } throw new ExceptionBuilder().withKeyword(TYPE).build(); }
@Override public Object visit(OWLClassAssertionAxiom axiom) { return visitAxiom(axiom, () -> df.getOWLClassAssertionAxiom(t(axiom.getClassExpression()), t(axiom .getIndividual()), t(axiom.annotations()))); }
/** * Invoked when an action occurs. */ public void actionPerformed(ActionEvent e) { OWLEntityCreationSet<OWLNamedIndividual> set = getOWLWorkspace().createOWLIndividual(); if (set == null) { return; } OWLClass thing = getOWLDataFactory().getOWLThing(); OWLAxiom ax = getOWLDataFactory().getOWLClassAssertionAxiom(thing, set.getOWLEntity()); getOWLModelManager().applyChange(new AddAxiom(getOWLModelManager().getActiveOntology(), ax)); }
/** * Invoked when an action occurs. */ public void actionPerformed(ActionEvent e) { OWLIndividual ind = getOWLWorkspace().createOWLIndividual().getOWLEntity(); OWLClass selectedClass = getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass(); OWLAxiom ax = getOWLDataFactory().getOWLClassAssertionAxiom(selectedClass, ind); getOWLModelManager().applyChange(new AddAxiom(getOWLModelManager().getActiveOntology(), ax)); } }