public OWLObjectProperty getOWLObjectProperty(String curi, PrefixManager prefixManager) { return getOWLObjectProperty(prefixManager.getIRI(curi)); }
public OWLObjectProperty getOWLBottomObjectProperty() { return getOWLObjectProperty(OWLRDFVocabulary.OWL_BOTTOM_OBJECT_PROPERTY.getIRI()); }
public OWLObjectProperty getOWLTopObjectProperty() { return getOWLObjectProperty(OWLRDFVocabulary.OWL_TOP_OBJECT_PROPERTY.getIRI()); }
@Override public OWLObjectProperty getOWLObjectProperty(String abbreviatedIRI, @Nonnull PrefixManager prefixManager) { checkNotNull(abbreviatedIRI, "curi canno be null"); checkNotNull(prefixManager, "prefixManager cannot be null"); return getOWLObjectProperty(prefixManager.getIRI(abbreviatedIRI)); }
@Override public SWRLDifferentIndividualsAtom getSWRLDifferentIndividualsAtom(SWRLIArgument arg0, SWRLIArgument arg1) { checkNotNull(arg0, ARG0_CANNOT_BE_NULL); checkNotNull(arg1, ARG1_CANNOT_BE_NULL); return new SWRLDifferentIndividualsAtomImpl( getOWLObjectProperty(OWLRDFVocabulary.OWL_DIFFERENT_FROM), arg0, arg1); }
@Override public SWRLSameIndividualAtom getSWRLSameIndividualAtom(SWRLIArgument arg0, SWRLIArgument arg1) { checkNotNull(arg0, ARG0_CANNOT_BE_NULL); checkNotNull(arg1, ARG1_CANNOT_BE_NULL); return new SWRLSameIndividualAtomImpl(getOWLObjectProperty(OWLRDFVocabulary.OWL_SAME_AS), arg0, arg1); }
@Override public SWRLSameIndividualAtom getSWRLSameIndividualAtom(SWRLIArgument arg0, SWRLIArgument arg1) { checkNotNull(arg0, ARG0_CANNOT_BE_NULL); checkNotNull(arg1, ARG1_CANNOT_BE_NULL); return new SWRLSameIndividualAtomImpl(getOWLObjectProperty(OWLRDFVocabulary.OWL_SAME_AS), arg0, arg1); }
@Nonnull @Override public SWRLDifferentIndividualsAtom getSWRLDifferentIndividualsAtom( SWRLIArgument arg0, SWRLIArgument arg1) { checkNotNull(arg0, "arg0 cannot be null"); checkNotNull(arg1, "arg1 cannot be null"); return new SWRLDifferentIndividualsAtomImpl( getOWLObjectProperty(OWLRDFVocabulary.OWL_DIFFERENT_FROM .getIRI()), arg0, arg1); }
@Nonnull @Override public SWRLSameIndividualAtom getSWRLSameIndividualAtom(SWRLIArgument arg0, SWRLIArgument arg1) { checkNotNull(arg0, "arg0 cannot be null"); checkNotNull(arg1, "arg1 cannot be null"); return new SWRLSameIndividualAtomImpl( getOWLObjectProperty(OWLRDFVocabulary.OWL_SAME_AS.getIRI()), arg0, arg1); }
@Override public OWLObjectProperty getOWLObjectProperty(String curi, PrefixManager prefixManager) { checkNull(curi, CURI2); checkNull(prefixManager, PREFIX_MANAGER); return getOWLObjectProperty(prefixManager.getIRI(curi)); }
@Override public SWRLDifferentIndividualsAtom getSWRLDifferentIndividualsAtom(SWRLIArgument arg0, SWRLIArgument arg1) { checkNotNull(arg0, ARG0_CANNOT_BE_NULL); checkNotNull(arg1, ARG1_CANNOT_BE_NULL); return new SWRLDifferentIndividualsAtomImpl( getOWLObjectProperty(OWLRDFVocabulary.OWL_DIFFERENT_FROM), arg0, arg1); }
@Override public SWRLSameIndividualAtom getSWRLSameIndividualAtom(SWRLIArgument arg0, SWRLIArgument arg1) { checkNotNull(arg0, ARG0_CANNOT_BE_NULL); checkNotNull(arg1, ARG1_CANNOT_BE_NULL); return new SWRLSameIndividualAtomImpl(getOWLObjectProperty(OWLRDFVocabulary.OWL_SAME_AS), arg0, arg1); }
@Override public SWRLSameIndividualAtom getSWRLSameIndividualAtom(SWRLIArgument arg0, SWRLIArgument arg1) { checkNotNull(arg0, ARG0_CANNOT_BE_NULL); checkNotNull(arg1, ARG1_CANNOT_BE_NULL); return new SWRLSameIndividualAtomImpl(getOWLObjectProperty(OWLRDFVocabulary.OWL_SAME_AS), arg0, arg1); }
@Override public SWRLDifferentIndividualsAtom getSWRLDifferentIndividualsAtom(SWRLIArgument arg0, SWRLIArgument arg1) { checkNotNull(arg0, ARG0_CANNOT_BE_NULL); checkNotNull(arg1, ARG1_CANNOT_BE_NULL); return new SWRLDifferentIndividualsAtomImpl( getOWLObjectProperty(OWLRDFVocabulary.OWL_DIFFERENT_FROM), arg0, arg1); }
@Override public SWRLDifferentIndividualsAtom getSWRLDifferentIndividualsAtom(SWRLIArgument arg0, SWRLIArgument arg1) { checkNotNull(arg0, ARG0_CANNOT_BE_NULL); checkNotNull(arg1, ARG1_CANNOT_BE_NULL); return new SWRLDifferentIndividualsAtomImpl( getOWLObjectProperty(OWLRDFVocabulary.OWL_DIFFERENT_FROM), arg0, arg1); }
@Nonnull @Override @SuppressWarnings("unchecked") public <E extends OWLEntity> E getOWLEntity( @Nonnull EntityType<E> entityType, IRI iri) { checkNotNull(entityType, "entityType cannot be null"); checkNotNull(iri, "iri cannot be null"); E ret = null; if (entityType.equals(EntityType.CLASS)) { ret = (E) getOWLClass(iri); } else if (entityType.equals(EntityType.OBJECT_PROPERTY)) { ret = (E) getOWLObjectProperty(iri); } else if (entityType.equals(EntityType.DATA_PROPERTY)) { ret = (E) getOWLDataProperty(iri); } else if (entityType.equals(EntityType.ANNOTATION_PROPERTY)) { ret = (E) getOWLAnnotationProperty(iri); } else if (entityType.equals(EntityType.NAMED_INDIVIDUAL)) { ret = (E) getOWLNamedIndividual(iri); } else if (entityType.equals(EntityType.DATATYPE)) { ret = (E) getOWLDatatype(iri); } if (ret != null) { return ret; } throw new OWLRuntimeException("Entity type not recognized: " + entityType + " for iri " + iri); }
@Override @SuppressWarnings("unchecked") public <E extends OWLEntity> E getOWLEntity(EntityType<E> entityType, IRI iri) { checkNull(entityType, "entityType"); checkNull(iri, IRI2); E ret = null; if (entityType.equals(EntityType.CLASS)) { ret = (E) getOWLClass(iri); } else if (entityType.equals(EntityType.OBJECT_PROPERTY)) { ret = (E) getOWLObjectProperty(iri); } else if (entityType.equals(EntityType.DATA_PROPERTY)) { ret = (E) getOWLDataProperty(iri); } else if (entityType.equals(EntityType.ANNOTATION_PROPERTY)) { ret = (E) getOWLAnnotationProperty(iri); } else if (entityType.equals(EntityType.NAMED_INDIVIDUAL)) { ret = (E) getOWLNamedIndividual(iri); } else if (entityType.equals(EntityType.DATATYPE)) { ret = (E) getOWLDatatype(iri); } return ret; }
public static void main(String[] args) throws Exception { SparqlEndpointKS ks = new SparqlEndpointKS(SparqlEndpoint.getEndpointDBpedia()); InverseObjectPropertyAxiomLearner l = new InverseObjectPropertyAxiomLearner(ks); l.setEntityToDescribe(new OWLDataFactoryImpl().getOWLObjectProperty(IRI .create("http://dbpedia.org/ontology/routeEnd"))); l.setMaxExecutionTimeInSeconds(60); // l.setForceSPARQL_1_0_Mode(true); // l.setReturnOnlyNewAxioms(true); l.init(); l.start(); System.out.println(l.getCurrentlyBestEvaluatedAxioms(10, 0.2)); }
public static void main(String[] args) throws Exception { InverseFunctionalObjectPropertyAxiomLearner l = new InverseFunctionalObjectPropertyAxiomLearner(new SparqlEndpointKS( SparqlEndpoint.getEndpointDBpediaLiveAKSW())); l.setEntityToDescribe(new OWLDataFactoryImpl().getOWLObjectProperty(IRI .create("http://dbpedia.org/ontology/birthPlace"))); l.setMaxExecutionTimeInSeconds(5); l.init(); l.start(); List<EvaluatedAxiom<OWLInverseFunctionalObjectPropertyAxiom>> axioms = l.getCurrentlyBestEvaluatedAxioms(5); System.out.println(axioms); for (EvaluatedAxiom<OWLInverseFunctionalObjectPropertyAxiom> axiom : axioms) { l.explainScore(axiom); } } }
public static void main(String[] args) throws Exception { FunctionalObjectPropertyAxiomLearner l = new FunctionalObjectPropertyAxiomLearner(new SparqlEndpointKS( SparqlEndpoint.getEndpointDBpedia())); l.setEntityToDescribe(new OWLDataFactoryImpl().getOWLObjectProperty(IRI .create("http://dbpedia.org/ontology/birthPlace"))); l.setMaxExecutionTimeInSeconds(20); l.setForceSPARQL_1_0_Mode(true); l.init(); l.start(); List<EvaluatedAxiom<OWLFunctionalObjectPropertyAxiom>> axioms = l.getCurrentlyBestEvaluatedAxioms(5); System.out.println(axioms); for (EvaluatedAxiom<OWLFunctionalObjectPropertyAxiom> axiom : axioms) { printSubset(l.getPositiveExamples(axiom), 10); printSubset(l.getNegativeExamples(axiom), 10); l.explainScore(axiom); } } }