Package org.apache.stanbol.ontologymanager.ontonet.impl.clerezza

Examples of org.apache.stanbol.ontologymanager.ontonet.impl.clerezza.ClerezzaOntologyProvider$OntologyToTcMapper


    @Test
    public void testGraphContentSource() throws Exception {
        // Make sure the tc manager has been reset
        assertEquals(1, tcManager.listTripleCollections().size());

        OntologyProvider<TcProvider> provider = new ClerezzaOntologyProvider(tcManager,
                new OfflineConfigurationImpl(new Hashtable<String,Object>()), parser);

        InputStream content = TestClerezzaInputSources.class
                .getResourceAsStream("/ontologies/droppedcharacters.owl");
        OntologyInputSource<?,TcProvider> src = new GraphContentInputSource(content, SupportedFormat.RDF_XML,
View Full Code Here


        serializer = new Serializer();
        serializer.bindSerializingProvider(new JenaSerializerProvider());
        serializer.bindSerializingProvider(new RdfJsonSerializingProvider());

        ontologyProvider = new ClerezzaOntologyProvider(tcManager, offline, parser);
        Dictionary<String,Object> onmconf = new Hashtable<String,Object>();
        onmconf.put(ONManager.ONTOLOGY_NETWORK_NS, "http://stanbol.apache.org/scope/");
        onManager = new ONManagerImpl(ontologyProvider, offline, onmconf);
    }
View Full Code Here

        OWLDataFactory df = OWLManager.getOWLDataFactory();
        OWLClass cHuman = df.getOWLClass(IRI.create(baseIri + "/" + Constants.humanBeing));
        OWLIndividual iLinus = df.getOWLNamedIndividual(IRI.create(baseIri + "/" + Constants.linus));
        linusIsHuman = df.getOWLClassAssertionAxiom(cHuman, iLinus);

        factory = new OntologySpaceFactoryImpl(reg, new ClerezzaOntologyProvider(tcManager, offline, parser),
                offline, IRI.create("http://stanbol.apache.org/ontology/"));
    }
View Full Code Here

        // We use a single Dictionary for storing all configurations.
        final Dictionary<String,Object> config = new Hashtable<String,Object>();
        config.put(OfflineConfiguration.ONTOLOGY_PATHS, new String[] {"/ontologies", "/ontologies/registry"});
        OfflineConfiguration offline = new OfflineConfigurationImpl(config);
        // The registry manager can be updated via calls to createModel()
        regman = new RegistryManagerImpl(offline, new ClerezzaOntologyProvider(new SimpleTcProvider(),
                offline, new Parser()), config);
    }
View Full Code Here

    public void setupTests() throws Exception {}

    @After
    public void cleanup() throws Exception {
        reset();
        provider = new ClerezzaOntologyProvider(tcManager, offline, parser);
    }
View Full Code Here

        IRI localTestRegistry = IRI.create(getClass().getResource(registryResourcePath));
        Dictionary<String,Object> regmanConf = new Hashtable<String,Object>();
        regmanConf.put(RegistryManager.REGISTRY_LOCATIONS, new String[] {localTestRegistry.toString()});
        // Instantiating the registry manager will also load the registry data.
        regMgr = new RegistryManagerImpl(offline, new ClerezzaOntologyProvider(tcManager, offline, parser),
                regmanConf);

        // The resulting manager must exist and have exactly one registry.
        assertNotNull(regMgr);
        Set<Registry> registries = regMgr.getRegistries();
View Full Code Here

        IRI localTestRegistry = IRI.create(getClass().getResource(registryResourcePath));
        Dictionary<String,Object> regmanConf = new Hashtable<String,Object>();
        regmanConf.put(RegistryManager.REGISTRY_LOCATIONS, new String[] {localTestRegistry.toString()});
        // Instantiating the registry manager will also load the registry data.
        regMgr = new RegistryManagerImpl(offline, new ClerezzaOntologyProvider(tcManager, offline, parser),
                regmanConf);
        assertNotNull(regMgr);

        // Now use this registry manager to instantiate an input source.
        OntologyInputSource<OWLOntology,?> src = new LibrarySource(Locations.LIBRARY_TEST1, regMgr,
View Full Code Here

                         Dictionary<String,Object> configuration) {
        /*
         * Assume this.tcm this.wtcp and this.wtcp were not filled in by OSGi-DS. As a matter of fact,
         * WeightedTcProvider is now ignored as we assume to use those bound with the TcManager.
         */
        this(new ClerezzaOntologyProvider(tcm, offline, new Parser()), offline, configuration);
    }
View Full Code Here

        // Create and set the cache.
        if (cachingPolicyString.equals(CachingPolicy.CENTRALISED.name())) {
            // this.cache = OWLOntologyManagerFactory.createOWLOntologyManager(offlineResources);
            if (cache == null) {
                log.warn("Caching policy is set as Centralised, but no ontology provider is supplied. Will use new in-memory tcProvider.");
                cache = new ClerezzaOntologyProvider(TcManager.getInstance(), offline, Parser.getInstance());
            }
            // else sta bene cosi'
        } else if (cachingPolicyString.equals(CachingPolicy.DISTRIBUTED.name())) {
            this.cache = null;
        }

        riFactory = new RegistryItemFactoryImpl(cache);

        // Build the model.
        createModel(regOnts);

        // Set the cache on libraries.
        Set<RegistryItem> visited = new HashSet<RegistryItem>();
        for (Registry reg : getRegistries())
            for (RegistryItem child : reg.getChildren())
                if (!visited.contains(child)) {
                    if (child instanceof Library) {
                        if (this.cache != null) ((Library) child).setCache(this.cache);
                        else ((Library) child).setCache(new ClerezzaOntologyProvider(TcManager.getInstance(),
                                offline, Parser.getInstance()));
                    }
                    visited.add(child);
                }
View Full Code Here

        // Also unload the ontology version that comes from this library.
    }

    @Override
    public void setCache(OntologyProvider<?> cache) {
        if (cache == null) cache = new ClerezzaOntologyProvider(TcManager.getInstance(), null,
                Parser.getInstance());
        else {
            Object store = cache.getStore();
            if (!(store instanceof TcProvider || store instanceof OWLOntologyManager)) throw new IllegalArgumentException(
                    "Type "
View Full Code Here

TOP

Related Classes of org.apache.stanbol.ontologymanager.ontonet.impl.clerezza.ClerezzaOntologyProvider$OntologyToTcMapper

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.