Package org.semanticweb.owlapi.util

Examples of org.semanticweb.owlapi.util.DefaultPrefixManager


            OWLDocumentFormat ontologyFormat = ontology.getOWLOntologyManager()
                    .getOntologyFormat(ontology);
            if (ontologyFormat instanceof PrefixManager) {
                delegate = (PrefixManager) ontologyFormat;
            } else {
                delegate = new DefaultPrefixManager();
            }
        }
View Full Code Here


     * @param format
     *        The format from which prefix name mappings will be reused
     */
    public ManchesterOWLSyntaxPrefixNameShortFormProvider(
            OWLDocumentFormat format) {
        prefixManager = new DefaultPrefixManager();
        if (format instanceof PrefixDocumentFormat) {
            PrefixDocumentFormat ontFormat = (PrefixDocumentFormat) format;
            prefixManager.copyPrefixesFrom(ontFormat);
            prefixManager.setPrefixComparator(ontFormat.getPrefixComparator());
        }
View Full Code Here

     */
    public FunctionalSyntaxObjectRenderer(@Nonnull OWLOntology ontology,
            Writer writer) {
        ont = ontology;
        this.writer = writer;
        prefixManager = new DefaultPrefixManager();
        OWLDocumentFormat ontologyFormat = ontology.getOWLOntologyManager()
                .getOntologyFormat(ontology);
        // reuse the setting on the existing format, if there is one
        if (ontologyFormat != null) {
            addMissingDeclarations = ontologyFormat.isAddMissingTypes();
View Full Code Here

            final Resource... contexts) {
        super(ontology, format);
        OpenRDFUtil.verifyContextNotNull(contexts);
        this.contexts = contexts;
        this.writer = writer;
        pm = new DefaultPrefixManager();
        if (!ontology.isAnonymous()) {
            String ontologyIRIString = ontology.getOntologyID()
                    .getOntologyIRI().get().toString();
            String defaultPrefix = ontologyIRIString;
            if (!ontologyIRIString.endsWith("/")) {
View Full Code Here

    public void testIndividual() throws OWLException {
        // :Mary is an instance of the class :Person.
        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(
View Full Code Here

    public void testPropertyAssertions() throws OWLException {
        // how to specify various property assertions for individuals
        OWLOntologyManager m = create();
        IRI ontologyIRI = IRI.create("http://example.com/owl/families/");
        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);
View Full Code Here

    private SWRLRule rule;

    @Before
    public void setUp() {
        OWLDataFactory dataFactory = new OWLDataFactoryImpl();
        PrefixManager pm = new DefaultPrefixManager(null, null,
                "http://stuff.com/A/");
        OWLClass clsA = Class("A", pm);
        OWLClass clsB = Class("B", pm);
        OWLClass clsC = Class("C", pm);
        OWLClass clsD = Class("D", pm);
View Full Code Here

    @Nonnull
    private PrefixManager nsm;

    /** default constructor */
    public PrefixDocumentFormatImpl() {
        this(new DefaultPrefixManager());
    }
View Full Code Here

        // The second is to use a prefix manager and specify abbreviated IRIs.
        // This is useful for creating lots of entities with the same prefix
        // IRIs. First create our prefix manager and specify that the default
        // prefix IRI (bound to the empty prefix name) is
        // http://www.semanticweb.org/owlapi/ontologies/ontology#
        PrefixManager pm = new DefaultPrefixManager(null, null,
                "http://www.semanticweb.org/owlapi/ontologies/ontology#");
        // Now we use the prefix manager and just specify an abbreviated IRI
        OWLClass clsAMethodB = factory.getOWLClass(":A", pm);
        // Note that clsAMethodA will be equal to clsAMethodB because they are
        // both OWLClass objects and have the same IRI. Creating entities in the
View Full Code Here

                integer, MIN_INCLUSIVE, eighteen);
        // We could use this datatype in restriction, as the range of data
        // properties etc. For example, if we want to restrict the range of the
        // :hasAge data property to 18 or more we specify its range as this data
        // range
        PrefixManager pm = new DefaultPrefixManager(null, null,
                "http://www.semanticweb.org/ontologies/dataranges#");
        OWLDataProperty hasAge = factory.getOWLDataProperty(":hasAge", pm);
        OWLDataPropertyRangeAxiom rangeAxiom = factory
                .getOWLDataPropertyRangeAxiom(hasAge, integerGE18);
        OWLOntology ontology = manager.createOntology(IRI
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.util.DefaultPrefixManager

Copyright © 2018 www.massapicom. 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.