SimpleOntology implements Ontology { @Override public Set<DataProperty> getAllClassDataProperties(IRI iri) { Set<DataProperty> properties = getIRISet(runQueryOnOntology(String.format(GET_CLASS_DATA_PROPERTIES, iri.stringValue()), null, "getAllClassDataProperties(" + iri.stringValue() + ")", true)) .stream() .map(SimpleDataProperty::new) .collect(Collectors.toSet()); properties.addAll(getAllNoDomainDataProperties()); return properties; } SimpleOntology(Model model, Repository cacheRepo, OntologyManager ontologyManager,
                          CatalogManager catalogManager, CatalogConfigProvider configProvider,
                          DatasetManager datasetManager, ImportsResolver importsResolver, SesameTransformer transformer,
                          BNodeService bNodeService, ValueFactory vf, ModelFactory mf);  SimpleOntology(String recordCommitKey, Model model, Repository cacheRepo, OntologyManager ontologyManager,
                          CatalogManager catalogManager, CatalogConfigProvider configProvider,
                          DatasetManager datasetManager, ImportsResolver importsResolver, SesameTransformer transformer,
                          BNodeService bNodeService, ValueFactory vf, ModelFactory mf);  SimpleOntology(String recordCommitKey, Repository cacheRepo, OntologyManager ontologyManager,
                          CatalogManager catalogManager, CatalogConfigProvider configProvider,
                          DatasetManager datasetManager, ImportsResolver importsResolver, SesameTransformer transformer,
                          BNodeService bNodeService, ValueFactory vf, ModelFactory mf); private  SimpleOntology(IRI datasetIRI, Model model, Repository cacheRepo, OntologyManager ontologyManager,
                           CatalogManager catalogManager, CatalogConfigProvider configProvider,
                           DatasetManager datasetManager, ImportsResolver importsResolver,
                           SesameTransformer transformer, BNodeService bNodeService, ValueFactory vf, ModelFactory mf); void setDifference(Difference difference); @Override Model asModel(ModelFactory factory); @Override OutputStream asTurtle(); @Override OutputStream asTurtle(OutputStream outputStream); @Override OutputStream asRdfXml(); @Override OutputStream asRdfXml(OutputStream outputStream); @Override OutputStream asOwlXml(); @Override OutputStream asOwlXml(OutputStream outputStream); @Override OutputStream asJsonLD(boolean skolemize); @Override OutputStream asJsonLD(boolean skolemize, OutputStream outputStream); @Override OntologyId getOntologyId(); @Override Set<IRI> getUnloadableImportIRIs(); @Override Set<Ontology> getImportsClosure(); @Override Set<IRI> getImportedOntologyIRIs(); @Override Set<Annotation> getOntologyAnnotations(); @Override Set<Annotation> getAllAnnotations(); @Override Set<AnnotationProperty> getAllAnnotationProperties(); @Override boolean containsClass(IRI iri); @Override Set<OClass> getAllClasses(); @Override Set<ObjectProperty> getAllClassObjectProperties(IRI iri); @Override Set<ObjectProperty> getAllNoDomainObjectProperties(); @Override Set<DataProperty> getAllClassDataProperties(IRI iri); @Override Set<DataProperty> getAllNoDomainDataProperties(); @Override Set<Datatype> getAllDatatypes(); @Override Set<ObjectProperty> getAllObjectProperties(); @Override Optional<ObjectProperty> getObjectProperty(IRI iri); @Override Set<Resource> getObjectPropertyRange(ObjectProperty objectProperty); @Override Set<DataProperty> getAllDataProperties(); @Override Optional<DataProperty> getDataProperty(IRI iri); @Override Set<Resource> getDataPropertyRange(DataProperty dataProperty); @Override Set<Individual> getAllIndividuals(); @Override Set<Individual> getIndividualsOfType(IRI classIRI); @Override Set<Individual> getIndividualsOfType(OClass clazz); @Override Hierarchy getSubClassesOf(ValueFactory vf, ModelFactory mf); @Override Set<IRI> getSubClassesFor(IRI iri); @Override Set<IRI> getSubPropertiesFor(IRI iri); @Override Hierarchy getSubDatatypePropertiesOf(ValueFactory vf, ModelFactory mf); @Override Hierarchy getSubAnnotationPropertiesOf(ValueFactory vf, ModelFactory mf); @Override Hierarchy getSubObjectPropertiesOf(ValueFactory vf, ModelFactory mf); @Override Hierarchy getClassesWithIndividuals(ValueFactory vf, ModelFactory mf); @Override TupleQueryResult getEntityUsages(Resource entity); @Override Model constructEntityUsages(Resource entity, ModelFactory modelFactory); @Override Hierarchy getConceptRelationships(ValueFactory vf, ModelFactory mf); @Override Hierarchy getConceptSchemeRelationships(ValueFactory vf, ModelFactory mf); @Override TupleQueryResult getSearchResults(String searchText, ValueFactory valueFactory); @Override TupleQueryResult getTupleQueryResults(String queryString, boolean includeImports); @Override Model getGraphQueryResults(String queryString, boolean includeImports, ModelFactory modelFactory); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void getAllClassDataPropertiesTest() throws Exception { assertEquals(2, ontology.getAllClassDataProperties(classIRI).size()); assertEquals(1, ontology.getAllClassDataProperties(classIRIC).size()); assertEquals(1, ontology.getAllClassDataProperties(classIRID).size()); assertEquals(1, ontology.getAllClassDataProperties(classIRIE).size()); }
@Test public void getAllClassDataPropertiesWithImportsTest() throws Exception { assertEquals(3, ont1.getAllClassDataProperties(importedIRI0).size()); assertEquals(3, ont1.getAllClassDataProperties(importedIRI).size()); }
@Test public void getAllClassDataPropertiesWhenMissingTest() throws Exception { assertEquals(1, ontology.getAllClassDataProperties(errorIRI).size()); }