protected List<Relationship> findLoadedRelationshipsByIntent(String intent, String workspaceId) { List<Relationship> results = new ArrayList<>(); for (Relationship relationship : getRelationships(workspaceId)) { String[] relationshipIntents = relationship.getIntents(); if (Arrays.asList(relationshipIntents).contains(intent)) { results.add(relationship); } } return results; }
public void updateIntents(String[] newIntents, User user, Authorizations authorizations) { ArrayList<String> toBeRemovedIntents = Lists.newArrayList(getIntents()); for (String newIntent : newIntents) { if (toBeRemovedIntents.contains(newIntent)) { toBeRemovedIntents.remove(newIntent); } else { addIntent(newIntent, user, authorizations); } } for (String toBeRemovedIntent : toBeRemovedIntents) { removeIntent(toBeRemovedIntent, authorizations); } }
for (String intent : relationship.getIntents()) { properties.put(OntologyRepository.CONFIG_INTENT_RELATIONSHIP_PREFIX + intent, relationship.getIRI());
private void validateTestOwlRelationship() { Relationship relationship = getOntologyRepository().getRelationshipByIRI(TEST_IRI + "#personKnowsPerson", PUBLIC); assertEquals("Knows", relationship.getDisplayName()); assertEquals("prop('http://visallo.org/test#firstMet') || ''", relationship.getTimeFormula()); assertTrue(relationship.getRangeConceptIRIs().contains("http://visallo.org/test#person")); assertTrue(relationship.getDomainConceptIRIs().contains("http://visallo.org/test#person")); relationship = getOntologyRepository().getRelationshipByIRI(TEST_IRI + "#personIsRelatedToPerson", PUBLIC); assertEquals("Is Related To", relationship.getDisplayName()); String[] intents = relationship.getIntents(); assertEquals(1, intents.length); assertEquals("test", intents[0]); assertTrue(relationship.getRangeConceptIRIs().contains("http://visallo.org/test#person")); assertTrue(relationship.getDomainConceptIRIs().contains("http://visallo.org/test#person")); }
result.setSubtitleFormula(getSubtitleFormula()); result.setTimeFormula(getTimeFormula()); if (getIntents() != null) { result.getIntents().addAll(Arrays.asList(getIntents()));