private Individual findRO(OntModel model, URI base) { try (ClosableIterable<? extends OntResource> instances = iterate(aggregation.listInstances())) { for (OntResource o : instances) // System.out.println("Woo " + o); return o.asIndividual(); } // Fallback - resolve as "/" // TODO: Ensure it's an Aggregation? return model.getIndividual(base.toString()); }
private Set<Individual> listObjectProperties(OntResource ontResource, ObjectProperty prop) { LinkedHashSet<Individual> results = new LinkedHashSet<>(); try (ClosableIterable<RDFNode> props = iterate(ontResource.listPropertyValues(prop))) { for (RDFNode node : props) { if (!node.isResource() || !node.canAs(Individual.class)) continue; results.add(node.as(Individual.class)); } } return results; }
public G4Service(OntResource individual) { super(individual); individual.addRDFType(CLASS); }