private void validateChangedOwlConcepts() throws IOException { Concept contact = getOntologyRepository().getConceptByIRI(TEST_IRI + "#contact", PUBLIC); Concept person = getOntologyRepository().getConceptByIRI(TEST_IRI + "#person", PUBLIC); assertEquals("Person", person.getDisplayName()); List<String> intents = Arrays.asList(person.getIntents()); assertEquals(1, intents.size()); assertFalse(intents.contains("person")); assertFalse(intents.contains("face")); assertTrue(intents.contains("test")); assertNull(person.getTimeFormula()); assertEquals("prop('http://visallo.org/test#name') || ''", person.getTitleFormula()); assertNull(person.getGlyphIcon()); assertEquals("rgb(28, 137, 28)", person.getColor()); Set<Concept> conceptAndAllChildren = getOntologyRepository().getConceptAndAllChildren(contact, PUBLIC); List<String> iris = Lists.newArrayList(); conceptAndAllChildren.forEach(c -> iris.add(c.getIRI())); assertEquals(2, iris.size()); assertTrue(iris.contains(contact.getIRI())); assertTrue(iris.contains(person.getIRI())); }
private void validateChangedOwlRelationships() throws IOException { Relationship relationship = getOntologyRepository().getRelationshipByIRI(TEST_IRI + "#personKnowsPerson", PUBLIC); assertEquals("Person Knows Person", relationship.getDisplayName()); assertNull(relationship.getTimeFormula()); assertTrue(relationship.getRangeConceptIRIs().contains("http://visallo.org/test#person2")); assertTrue(relationship.getRangeConceptIRIs().contains("http://visallo.org/test#person")); assertTrue(relationship.getDomainConceptIRIs().contains("http://visallo.org/test#person")); Concept thing = getOntologyRepository().getEntityConcept(workspaceId); assertNotNull(thing.getTitleFormula()); assertNotNull(thing.getSubtitleFormula()); assertNotNull(thing.getTimeFormula()); }
private void validateTestOwlConcepts(int expectedIriSize) throws IOException { Concept contact = getOntologyRepository().getConceptByIRI(TEST_IRI + "#contact", PUBLIC); assertEquals("Contact", contact.getDisplayName()); assertEquals("rgb(149, 138, 218)", contact.getColor()); assertEquals("test", contact.getDisplayType()); List<String> intents = Arrays.asList(contact.getIntents()); assertEquals(1, intents.size()); assertTrue(intents.contains("face")); Concept person = getOntologyRepository().getConceptByIRI(TEST_IRI + "#person", PUBLIC); assertEquals("Person", person.getDisplayName()); intents = Arrays.asList(person.getIntents()); assertEquals(1, intents.size()); assertTrue(intents.contains("person")); assertEquals("prop('http://visallo.org/test#birthDate') || ''", person.getTimeFormula()); assertEquals("prop('http://visallo.org/test#name') || ''", person.getTitleFormula()); byte[] bytes = IOUtils.toByteArray(OntologyRepositoryTestBase.class.getResourceAsStream("glyphicons_003_user@2x.png")); assertArrayEquals(bytes, person.getGlyphIcon()); assertEquals("rgb(28, 137, 28)", person.getColor()); Set<Concept> conceptAndAllChildren = getOntologyRepository().getConceptAndAllChildren(contact, PUBLIC); List<String> iris = Lists.newArrayList(); conceptAndAllChildren.forEach(c -> iris.add(c.getIRI())); assertEquals(expectedIriSize, iris.size()); assertTrue(iris.contains(contact.getIRI())); assertTrue(iris.contains(person.getIRI())); }
@Test public void testProperlyConfiguredThingConcept() throws Exception { createSampleOntology(); Concept thing = getOntologyRepository().getEntityConcept(workspaceId); assertNotNull(thing.getTitleFormula()); assertNotNull(thing.getSubtitleFormula()); assertNotNull(thing.getTimeFormula()); }
concept.setSubtitleFormula(getSubtitleFormula()); if (getTimeFormula() != null) { concept.setTimeFormula(getTimeFormula());