private File getRootPath(OWLIndividual i) { for (OWLLiteral rootPathLiteral : i.getDataPropertyValues(HAS_ROOT_PATH, ontology)) { String rootPath = rootPathLiteral.getLiteral(); return new File(rootPath); } return new File("root"); }
private File getConfigurationPath(OWLIndividual i) { for (OWLLiteral rootPathLiteral : i.getDataPropertyValues(HAS_CONFIGURATION_PATH, ontology)) { String configurationPath = rootPathLiteral.getLiteral(); return new File(configurationPath); } return new File("configuration"); }
private int getServerPort(OWLIndividual i) { for (OWLLiteral hostPortLiteral : i.getDataPropertyValues(HAS_SERVER_PORT, ontology)) { if (hostPortLiteral.isInteger()) { int port = hostPortLiteral.parseInteger(); return port; } } return 0; }
@Override public Collection<IProperty> getDataRelationships() { List<IProperty> ret = new ArrayList<>(); Map<OWLDataPropertyExpression, Set<OWLLiteral>> pvals = individual.getDataPropertyValues(ontology); for (OWLDataPropertyExpression p : pvals.keySet()) { IProperty prop = ((Concept)concept)._manager.getPropertyFor(p.asOWLDataProperty().getIRI()); if (prop != null) { ret.add(prop); } } return ret; }
/** * Get the list of scopes to activate on startup * * @param config * @return */ public static String[] getScopesToActivate(OWLOntology config) { Set<OWLIndividual> scopes = cScope.getIndividuals(config); List<String> result = new ArrayList<String>(); boolean doActivate = false; for (OWLIndividual iScope : scopes) { Set<OWLLiteral> activate = iScope.getDataPropertyValues(activateOnStart, config); Iterator<OWLLiteral> it = activate.iterator(); while (it.hasNext() && !doActivate) { OWLLiteral l = it.next(); doActivate |= Boolean.parseBoolean(l.getLiteral()); } if (iScope.isNamed() && doActivate) result.add(((OWLNamedIndividual) iScope).getIRI().toString()); } return result.toArray(EMPTY_IRI_ARRAY); }
private int getRegistryPort(OWLIndividual i) { for (OWLLiteral hostPortLiteral : i.getDataPropertyValues(HAS_REGISTRY_PORT, ontology)) { if (hostPortLiteral.isInteger()) { int port = hostPortLiteral.parseInteger(); return port; } } return Registry.REGISTRY_PORT; }
/** * Get the list of scopes to activate on startup * * @param config * @return */ public static String[] getScopesToActivate(OWLOntology config) { Set<OWLIndividual> scopes = cScope.getIndividuals(config); List<String> result = new ArrayList<String>(); boolean doActivate = false; for (OWLIndividual iScope : scopes) { Set<OWLLiteral> activate = iScope.getDataPropertyValues(activateOnStart, config); Iterator<OWLLiteral> it = activate.iterator(); while (it.hasNext() && !doActivate) { OWLLiteral l = it.next(); doActivate |= Boolean.parseBoolean(l.getLiteral()); } if (iScope.isNamed() && doActivate) result.add(((OWLNamedIndividual) iScope).getIRI().toString()); } return result.toArray(EMPTY_IRI_ARRAY); }
/** * Get the list of scopes to activate on startup * * @param config * @return */ public static String[] getScopesToActivate(OWLOntology config) { Set<OWLIndividual> scopes = cScope.getIndividuals(config); List<String> result = new ArrayList<String>(); boolean doActivate = false; for (OWLIndividual iScope : scopes) { Set<OWLLiteral> activate = iScope.getDataPropertyValues( activateOnStart, config); Iterator<OWLLiteral> it = activate.iterator(); while (it.hasNext() && !doActivate) { OWLLiteral l = it.next(); doActivate |= Boolean.parseBoolean(l.getLiteral()); } if (iScope.isNamed() && doActivate) result.add(((OWLNamedIndividual) iScope).getIRI().toString()); } return result.toArray(EMPTY_IRI_ARRAY); }
@Override public Collection<Object> getData(IProperty property) { List<Object> ret = new ArrayList<>(); for (OWLLiteral dat : individual.getDataPropertyValues(((Property)property)._owl.asOWLDataProperty(), ontology)) { if (dat.isBoolean()) { ret.add(dat.parseBoolean()); } else if (dat.isBoolean()) { ret.add(dat.parseBoolean()); } else if (dat.isDouble()) { ret.add(dat.parseDouble()); } else if (dat.isFloat()) { ret.add(dat.parseFloat()); } else if (dat.isInteger()) { ret.add(dat.parseFloat()); } else { ret.add(dat.getLiteral()); } } return ret; }