private Concept getOntologyConcept(String conceptType, Ontology ontology, String workspaceId) { if (conceptType == null) { return null; } return ontology == null ? ontologyRepository.getConceptByIRI(conceptType, workspaceId) : ontology.getConceptByIri(conceptType); } }
public SandboxStatus getSandboxStatus() { for (Concept concept : getConcepts()) { SandboxStatus sandboxStatus = concept.getSandboxStatus(); if (sandboxStatus != SandboxStatus.PUBLIC) { return sandboxStatus; } } for (Relationship relationship : getRelationships()) { SandboxStatus sandboxStatus = relationship.getSandboxStatus(); if (sandboxStatus != SandboxStatus.PUBLIC) { return sandboxStatus; } } for (OntologyProperty property : getProperties()) { SandboxStatus sandboxStatus = property.getSandboxStatus(); if (sandboxStatus != SandboxStatus.PUBLIC) { return sandboxStatus; } } return SandboxStatus.PUBLIC; } }
private Relationship getOntologyRelationshipFromElement(String edgeLabel, Ontology ontology, String workspaceId) { checkNotNull(edgeLabel, "Edge label cannot be null"); Relationship relationship = ontology == null ? ontologyRepository.getRelationshipByIRI(edgeLabel, workspaceId) : ontology.getRelationshipByIri(edgeLabel); checkNotNull(relationship, edgeLabel + " does not exist in ontology"); return relationship; }
.map(p -> (ExtendedDataTableProperty) p) .collect(Collectors.toList()); ontology = new Ontology( concepts, relationships, if (!PUBLIC.equals(workspaceId) && ontology.getSandboxStatus() == SandboxStatus.PUBLIC) { ontology = getOntology(PUBLIC);
String iri = VisalloProperties.CONCEPT_TYPE.getPropertyValue(clientApiElement); while (iri != null) { Concept concept = ontology == null ? ontologyRepository.getConceptByIRI(iri, workspaceId) : ontology.getConceptByIri(iri); if (concept == null) { LOGGER.warn("Could not find concept: %s", iri); String iri = ((ClientApiEdge) clientApiElement).getLabel(); while (iri != null) { Relationship relationship = ontology == null ? ontologyRepository.getRelationshipByIRI(iri, workspaceId) : ontology.getRelationshipByIri(iri); if (relationship == null) { LOGGER.warn("Could not find relationship: %s", iri);
@Override @SuppressWarnings("unchecked") public ClientApiOntology getClientApiObject(String workspaceId) { Ontology ontology = getOntology(workspaceId); Object[] results = ExecutorServiceUtil.runAllAndWait( () -> Concept.toClientApiConcepts(ontology.getConcepts()), () -> OntologyProperty.toClientApiProperties(ontology.getProperties()), () -> Relationship.toClientApiRelationships(ontology.getRelationships()) ); ClientApiOntology clientOntology = new ClientApiOntology(); clientOntology.addAllConcepts((Collection<ClientApiOntology.Concept>) results[0]); clientOntology.addAllProperties((Collection<ClientApiOntology.Property>) results[1]); clientOntology.addAllRelationships((Collection<ClientApiOntology.Relationship>) results[2]); return clientOntology; }