@Override protected String convert(OntologyProperty o) { return o.getTitle(); } });
public String getIri() { return getTitle(); }
@Override public String getPropertyIRIByIntent(String intent, String workspaceId) { OntologyProperty prop = getPropertyByIntent(intent, workspaceId); if (prop != null) { return prop.getTitle(); } return null; }
@Override public String getRequiredPropertyIRIByIntent(String intent, String workspaceId) { return getRequiredPropertyByIntent(intent, workspaceId).getTitle(); }
@Override public void resolvePropertyIds(JSONArray filterJson, String workspaceId) throws JSONException { for (int i = 0; i < filterJson.length(); i++) { JSONObject filter = filterJson.getJSONObject(i); if (filter.has("propertyId") && !filter.has("propertyName")) { String propertyVertexId = filter.getString("propertyId"); OntologyProperty property = getPropertyByIRI(propertyVertexId, workspaceId); if (property == null) { throw new RuntimeException("Could not find property with id: " + propertyVertexId); } filter.put("propertyName", property.getTitle()); filter.put("propertyDataType", property.getDataType()); } } }
Set<String> addedPropertyNames = new HashSet<>(); for (OntologyProperty ontologyProperty : ontologyProperties) { String propertyName = ontologyProperty.getTitle(); for (ClientApiProperty property : clientApiElement.getProperties(propertyName)) { ClientApiPropertyAcl acl = newClientApiPropertyAcl( .filter(ontologyProperty -> !addedPropertyNames.contains(ontologyProperty.getTitle())) .map(ontologyProperty -> { String propertyName = ontologyProperty.getTitle(); ClientApiPropertyAcl acl = newClientApiPropertyAcl( clientApiElement,
properties.put(OntologyRepository.CONFIG_INTENT_PROPERTY_PREFIX + intent, property.getTitle());
result.getProperties().add(property.getTitle());
@Handle public ClientApiElementSearchResponse handle( @Required(name = "lat") double latitude, @Required(name = "lon") double longitude, @Required(name = "radius") double radius, @ActiveWorkspaceId String workspaceId, Authorizations authorizations ) throws Exception { ClientApiElementSearchResponse results = new ClientApiElementSearchResponse(); for (OntologyProperty property : this.ontologyRepository.getProperties(workspaceId)) { if (property.getDataType() != PropertyType.GEO_LOCATION) { continue; } Iterable<Vertex> vertices = graph.query(authorizations). has(property.getTitle(), GeoCompare.WITHIN, new GeoCircle(latitude, longitude, radius)). vertices(); for (Vertex vertex : vertices) { results.getElements().add(ClientApiConverter.toClientApiVertex(vertex, workspaceId, authorizations)); } } return results; } }
result = new ClientApiOntology.Property(); result.setTitle(getTitle()); result.setDisplayName(getDisplayName()); result.setUserVisible(getUserVisible());
concept.getProperties().add(property.getTitle());