Search in sources :

Example 11 with Ontology

use of fr.lirmm.graphik.graal.api.core.Ontology in project graal by graphik-team.

the class DefaultOntologyTest method testGetRuleNames_empty.

// /////////////////////////////////////////////////////////////////////////
// EMPTY ONTO CASE
// /////////////////////////////////////////////////////////////////////////
/**
 * Test method for
 * {@link fr.lirmm.graphik.graal.core.ruleset.DefaultOntology#getRuleNames()}.
 */
@Test
public void testGetRuleNames_empty() {
    // given
    Ontology onto = new DefaultOntology();
    // when
    Set<String> ruleNames = onto.getRuleNames();
    // then
    Assert.assertTrue(ruleNames.isEmpty());
}
Also used : Ontology(fr.lirmm.graphik.graal.api.core.Ontology) Test(org.junit.Test)

Example 12 with Ontology

use of fr.lirmm.graphik.graal.api.core.Ontology in project graal by graphik-team.

the class DefaultOntologyTest method testSize_empty.

/**
 * Test method for
 * {@link fr.lirmm.graphik.graal.core.ruleset.DefaultOntology#size()}.
 */
@Test
public void testSize_empty() {
    // given
    Ontology onto = new DefaultOntology();
    // when
    int size = onto.size();
    // then
    Assert.assertEquals(0, size);
}
Also used : Ontology(fr.lirmm.graphik.graal.api.core.Ontology) Test(org.junit.Test)

Example 13 with Ontology

use of fr.lirmm.graphik.graal.api.core.Ontology in project graal by graphik-team.

the class DefaultOntologyTest method testAddDifferentRulesWithSameName.

/**
 * Test method for
 * {@link fr.lirmm.graphik.graal.core.ruleset.DefaultOntology#add(Rule)}.
 */
@Test
public void testAddDifferentRulesWithSameName() {
    // given
    Ontology onto = new DefaultOntology();
    // when
    onto.add(same1);
    onto.add(same2);
    // then
    Assert.assertEquals(2, onto.size());
}
Also used : Ontology(fr.lirmm.graphik.graal.api.core.Ontology) Test(org.junit.Test)

Aggregations

Ontology (fr.lirmm.graphik.graal.api.core.Ontology)13 Test (org.junit.Test)13 Rule (fr.lirmm.graphik.graal.api.core.Rule)3 DefaultRule (fr.lirmm.graphik.graal.core.DefaultRule)2 DefaultOntology (fr.lirmm.graphik.graal.core.ruleset.DefaultOntology)2 InMemoryAtomSet (fr.lirmm.graphik.graal.api.core.InMemoryAtomSet)1 Chase (fr.lirmm.graphik.graal.api.forward_chaining.Chase)1 KnowledgeBase (fr.lirmm.graphik.graal.api.kb.KnowledgeBase)1 DefaultInMemoryGraphStore (fr.lirmm.graphik.graal.core.atomset.graph.DefaultInMemoryGraphStore)1 BreadthFirstChase (fr.lirmm.graphik.graal.forward_chaining.BreadthFirstChase)1