Examples of OWLNamedIndividual


Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

        @SuppressWarnings("null")
        IRI allTestURI = IRI.create(resourceURL);
        OWLOntology testCasesOntology = m
                .loadOntologyFromOntologyDocument(allTestURI);
        OWLClass profileIdentificationTestClass = Class(profile);
        OWLNamedIndividual el = df.getOWLNamedIndividual(elIRI);
        OWLNamedIndividual ql = df.getOWLNamedIndividual(qlIRI);
        OWLNamedIndividual rl = df.getOWLNamedIndividual(rlIRI);
        OWLObjectProperty speciesProperty = df.getOWLObjectProperty(species);
        OWLNamedIndividual full = df.getOWLNamedIndividual(fullIRI);
        OWLNamedIndividual dl = df.getOWLNamedIndividual(dlIRI);
        OWLDataProperty rdfXMLPremiseOntologyProperty = df
                .getOWLDataProperty(premiseIRI);
        for (OWLClassAssertionAxiom ax : testCasesOntology
                .getClassAssertionAxioms(profileIdentificationTestClass)) {
            OWLIndividual ind = ax.getIndividual();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

        OWLOntologyManager m = create();
        // The IRIs used here are taken from the OWL 2 Primer
        String base = "http://example.com/owl/families/";
        PrefixManager pm = new DefaultPrefixManager(null, null, base);
        OWLClass person = df.getOWLClass(":Person", pm);
        OWLNamedIndividual mary = df.getOWLNamedIndividual(":Mary", pm);
        // create a ClassAssertion to specify that :Mary is an instance of
        // :Person
        OWLClassAssertionAxiom classAssertion = df.getOWLClassAssertionAxiom(
                person, mary);
        OWLOntology o = m.createOntology(IRI.create(base));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

        OWLOntology o = m.createOntology(ontologyIRI);
        PrefixManager pm = new DefaultPrefixManager(null, null,
                ontologyIRI.toString());
        // Let's specify the :John has a wife :Mary
        // Get hold of the necessary individuals and object property
        OWLNamedIndividual john = df.getOWLNamedIndividual(":John", pm);
        OWLNamedIndividual mary = df.getOWLNamedIndividual(":Mary", pm);
        OWLObjectProperty hasWife = df.getOWLObjectProperty(":hasWife", pm);
        // To specify that :John is related to :Mary via the :hasWife property
        // we create an object property
        // assertion and add it to the ontology
        OWLObjectPropertyAssertionAxiom propertyAssertion = df
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    @Test
    public void testRoundTripWithAnonymousIndividuals() throws Exception {
        String ns = "http://test.com/genid#";
        IRI ont = IRI.create(ns + "ontology.owl");
        OWLNamedIndividual i = df.getOWLNamedIndividual(IRI.create(ns, "i"));
        OWLObjectProperty p = df.getOWLObjectProperty(IRI.create(ns, "p"));
        OWLDataProperty q = df.getOWLDataProperty(IRI.create(ns, "q"));
        OWLOntology ontology = m.createOntology(ont);
        OWLIndividual ind = df.getOWLAnonymousIndividual();
        OWLObjectPropertyAssertionAxiom ax1 = df
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    @Nonnull
    Map<OWLAnnotationProperty, List<String>> langMap = new HashMap<>();

    @Test
    public void testLiteralWithoutLanguageValue() {
        OWLNamedIndividual root = NamedIndividual("ind", pm);
        String shortForm = "MyLabel";
        Ontology(m,
                AnnotationAssertion(prop, root.getIRI(), Literal(shortForm)));
        AnnotationValueShortFormProvider sfp = new AnnotationValueShortFormProvider(
                props, langMap, m);
        assertEquals(sfp.getShortForm(root), shortForm);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

        assertEquals(sfp.getShortForm(root), shortForm);
    }

    @Test
    public void testLiteralWithLanguageValue() {
        OWLNamedIndividual root = NamedIndividual("ind", pm);
        String label1 = "MyLabel";
        String label2 = "OtherLabel";
        Ontology(
                m,
                AnnotationAssertion(prop, root.getIRI(), Literal(label1, "ab")),
                AnnotationAssertion(prop, root.getIRI(), Literal(label2, "xy")));
        langMap.put(prop, Arrays.asList("ab", "xy"));
        AnnotationValueShortFormProvider sfp = new AnnotationValueShortFormProvider(
                props, langMap, m);
        assertEquals(sfp.getShortForm(root), label1);
        Map<OWLAnnotationProperty, List<String>> langMap2 = new HashMap<>();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

        assertEquals(sfp2.getShortForm(root), label2);
    }

    @Test
    public void testIRIValue() {
        OWLNamedIndividual root = NamedIndividual("ind", pm);
        Ontology(
                m,
                AnnotationAssertion(prop, root.getIRI(),
                        IRI("http://org.semanticweb.owlapi/ont#myIRI")));
        AnnotationValueShortFormProvider sfp = new AnnotationValueShortFormProvider(
                props, langMap, m);
        assertEquals("myIRI", sfp.getShortForm(root));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

        assertEquals("myIRI", sfp.getShortForm(root));
    }

    @Test
    public void shouldWrapWithDoubleQuotes() {
        OWLNamedIndividual root = NamedIndividual("ind", pm);
        String shortForm = "MyLabel";
        Ontology(m,
                AnnotationAssertion(prop, root.getIRI(), Literal(shortForm)));
        AnnotationValueShortFormProvider sfp = new AnnotationValueShortFormProvider(
                m, new SimpleShortFormProvider(),
                new SimpleIRIShortFormProvider(), props, langMap);
        sfp.setLiteralRenderer(new StringAnnotationVisitor() {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    }

    @Test
    public void testCorrectAxiomAnnotated() throws OWLOntologyCreationException {
        OWLOntology ontology = createOntology();
        OWLNamedIndividual subject = NamedIndividual(IRI("http://Example.com#myBuilding"));
        OWLObjectProperty predicate = ObjectProperty(IRI("http://Example.com#located_at"));
        OWLNamedIndividual object = NamedIndividual(IRI("http://Example.com#myLocation"));
        OWLAxiom ax = ObjectPropertyAssertion(predicate, subject, object);
        assertTrue(ontology.containsAxiom(ax, EXCLUDED,
                AxiomAnnotations.IGNORE_AXIOM_ANNOTATIONS));
        Set<OWLAxiom> axioms = ontology
                .getAxiomsIgnoreAnnotations(ax, EXCLUDED);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual

    public void testNamedIndividualAccessor() {
        OWLOntology ont = getOWLOntology("ontology");
        OWLAnnotationAssertionAxiom ax = createAnnotationAssertionAxiom();
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.getAnnotationAssertionAxioms(SUBJECT).contains(ax));
        OWLNamedIndividual cls = NamedIndividual(SUBJECT);
        Set<OWLAnnotationAssertionAxiom> axioms = ont
                .getAnnotationAssertionAxioms(cls.getIRI());
        assertTrue(axioms.contains(ax));
        assertTrue(annotations(axioms).contains(ax.getAnnotation()));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.