Package com.hp.hpl.jena.util

Examples of com.hp.hpl.jena.util.FileManager


        indexDir = FSDirectory.open(dir);
        if (!dir.isDirectory()) {

            // load the skos model from the given file
            FileManager fileManager = new FileManager();
            fileManager.addLocatorFile();
            fileManager.addLocatorURL();
            fileManager.addLocatorClassLoader(SKOSEngineImpl.class.getClassLoader());

            if (getExtension(filenameOrURI).equals("zip")) {
                fileManager.addLocatorZip(filenameOrURI);
                filenameOrURI = getBaseName(filenameOrURI);
            }

            skosModel = fileManager.loadModel(filenameOrURI);
            entailSKOSModel();
            indexSKOSModel();
        }

        searcher = new IndexSearcher(DirectoryReader.open(indexDir));
View Full Code Here


        if (configPath == null) {
            return null;
        }

        // Make a temporary file manager to look for the metadata file
        FileManager fm = new FileManager();
        fm.addLocatorFile();
        fm.addLocatorURL();
        fm.addLocatorClassLoader( fm.getClass().getClassLoader() );

        try {
            String uri = null ;
            InputStream in = null ;

            StringTokenizer pathElems = new StringTokenizer( configPath, FileManager.PATH_DELIMITER );
            while (in == null && pathElems.hasMoreTokens()) {
                uri = pathElems.nextToken();
                in = fm.openNoMap( uri );
            }

            if (in != null) {
                String syntax = FileUtils.guessLang(uri);
                Model model = ModelFactory.createDefaultModel() ;
View Full Code Here

        assertEquals( "abc@def", f.insert( "abc@@def" ) );
        }
   
    @Test public void testSingleFilenameWithInsertion()
        {
        FileManager fm = new FakeFileManager( "spoo", "XXX" );
        FileInsertion f = new FileInsertion( fm );
        assertEquals( "XXX", f.insert( "@'spoo'" ) );
        assertEquals( "abcXXXdefXXXghi", f.insert( "abc@'spoo'def@'spoo'ghi" ) );
        assertEquals( "abcXXXdefXXXghi", f.insert( "abc@\"spoo\"def@'spoo'ghi" ) );
        assertEquals( "abcXXXdefXXXghi", f.insert( "abc@'spoo'def@\"spoo\"ghi" ) );
View Full Code Here

        assertEquals( "abcXXXdefXXXghi", f.insert( "abc@'spoo'def@\"spoo\"ghi" ) );
        }
   
    @Test public void testMultipleFilenamesWithInsertion()
        {
        FileManager fm = new FakeFileManager( "d", "Dirac" ).set( "q", "quincunx" );
        FileInsertion f = new FileInsertion( fm );
        assertEquals( "abc|Dirac|def|quincunx|ghi", f.insert( "abc|@'d'|def|@'q'|ghi" ) );
        }
View Full Code Here

//            addProperties( models.next() );
        }
   
    private void addBuiltinProperties()
        {
        FileManager fm = FileManager.get();
        OntModel builtin = ModelFactory.createOntologyModel( OntModelSpec.RDFS_MEM_RDFS_INF );
        builtin.addSubModel( fm.loadModel( RDF.getURI() ) );
        builtin.addSubModel( fm.loadModel( RDFS.getURI() ) );
        addProperties( builtin );
        }
View Full Code Here

            }
        }
   
    public VocabularyInspector()
        {
        FileManager fm = FileManager.get();
        addVocabulary( fm.loadModel( RDF.getURI() ) );
        addVocabulary( fm.loadModel( RDFS.getURI() ) );
        addVocabulary( fm.loadModel( EyeballVocabularyBase.XSD_URI ) );
        }
View Full Code Here

        }
   
    @Test public void testTextRendererConfiguresVocabulary()
        {
        Resource root = resourceInModel( "root eye:labels 'spoo'" );
        FileManager fm = new FileManager()
            {
            public Model loadModel( String name )
                {
                assertEquals( "spoo", name );
                return model( "example rdfs:label 'label-for-example'" );
View Full Code Here

   
    @Test public void testEyeballNamedAssumptions()
        {
        final Model expected = model( "sing something simple" );
        Resource r = resourceInModel( "x rdf:type eye:Eyeball & eye:assume 'modelName'" );
        FileManager fm = new FileManager()
            {
            public Model loadModel( String name )
                {
                assertEquals( "modelName", name );
                return expected;
View Full Code Here

        if (configPath == null) {
            return null;
        }

        // Make a temporary file manager to look for the metadata file
        FileManager fm = new FileManager();
        fm.addLocatorFile();
        fm.addLocatorURL();
        fm.addLocatorClassLoader( fm.getClass().getClassLoader() );

        try {
            String uri = null ;
            InputStream in = null ;

            StringTokenizer pathElems = new StringTokenizer( configPath, FileManager.PATH_DELIMITER );
            while (in == null && pathElems.hasMoreTokens()) {
                uri = pathElems.nextToken();
                in = fm.openNoMap( uri );
            }

            if (in != null) {
                String syntax = FileUtils.guessLang(uri);
                Model model = ModelFactory.createDefaultModel() ;
View Full Code Here

       
        if ( cmdLine.contains(lmapDecl) )
        {
            String lmapFile = cmdLine.getValue(lmapDecl) ;
            LocationMapper locMap = new LocationMapper(lmapFile) ;
            fileManager = new FileManager(locMap) ;
        }
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.util.FileManager

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.