Examples of JenaParserProvider


Examples of org.apache.clerezza.rdf.jena.parser.JenaParserProvider

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    model.write(out);
   
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
   
    ParsingProvider parser = new JenaParserProvider();   
   
    MGraph mGraph = new SimpleMGraph();
    parser.parse(mGraph,in, SupportedFormat.RDF_XML, null);
   
    return mGraph;
   
  }
View Full Code Here

Examples of org.apache.clerezza.rdf.jena.parser.JenaParserProvider

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        OWLOntologyManager manager = ontology.getOWLOntologyManager();
        try {
            manager.saveOntology(ontology, new RDFXMLOntologyFormat(), out);
            ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
            ParsingProvider parser = new JenaParserProvider();
            mGraph = new SimpleMGraph();
            parser.parse(mGraph, in, SupportedFormat.RDF_XML, null);
        } catch (OWLOntologyStorageException e) {
            log.error("Failed to serialize OWL Ontology " + ontology + "for conversion", e);
        }
        return mGraph;
View Full Code Here

Examples of org.apache.clerezza.rdf.jena.parser.JenaParserProvider

    private ContentItemBackend backend;
    private LDPath<Resource> ldpath;
    @BeforeClass
    public static void readTestData() throws IOException {
        //add the metadata
        ParsingProvider parser = new JenaParserProvider();
        //create the content Item with the HTML content
        MGraph rdfData = parseRdfData(parser,"metadata.rdf.zip");
        UriRef contentItemId = null;
        Iterator<Triple> it = rdfData.filter(null, Properties.ENHANCER_EXTRACTED_FROM, null);
        while(it.hasNext()){
View Full Code Here

Examples of org.apache.clerezza.rdf.jena.parser.JenaParserProvider

    }

    @Test
    public void testImportModelFromSKOS() throws Exception {
        Parser parser = Parser.getInstance();
        parser.bindParsingProvider(new JenaParserProvider());
        Graph graph = parser.parse(getClass().getResourceAsStream("/sample-scheme.skos.rdf.xml"),
            SupportedFormat.RDF_XML);
        int imported = classifier.importConceptsFromGraph(graph, OntologicalClasses.SKOS_CONCEPT,
            Properties.SKOS_BROADER);
        assertEquals(imported, 4);
View Full Code Here

Examples of org.apache.clerezza.rdf.jena.parser.JenaParserProvider

        }
        return data;
    }

    private Graph parseResponse(InputStream is) {
        JenaParserProvider jenaParserProvider = new JenaParserProvider();
        //NOTE(rw): the new third parameter is the base URI used to resolve relative paths
        MGraph g = new SimpleMGraph();
        jenaParserProvider.parse(g,is, SupportedFormat.RDF_XML,null);
        log.debug("graph: " + g.toString());
        return g.getGraph();
    }
View Full Code Here

Examples of org.apache.clerezza.rdf.jena.parser.JenaParserProvider

    public static void reset() {
        tcManager = new TcManager();
        tcManager.addWeightedTcProvider(new SimpleTcProvider());

        parser = new Parser();
        parser.bindParsingProvider(new JenaParserProvider());
        parser.bindParsingProvider(new RdfJsonParsingProvider());

        serializer = new Serializer();
        serializer.bindSerializingProvider(new JenaSerializerProvider());
        serializer.bindSerializingProvider(new RdfJsonSerializingProvider());
View Full Code Here

Examples of org.apache.clerezza.rdf.jena.parser.JenaParserProvider

        if(__parser == null){
            if(context != null){
                __parser = ContextHelper.getServiceFromContext(Parser.class, context);
            } else { //mainly for unit tests we want also allow initialisation without context
                __parser = new Parser();
                __parser.bindParsingProvider(new JenaParserProvider());
            }
        }
        return __parser;
    }
View Full Code Here

Examples of org.apache.clerezza.rdf.jena.parser.JenaParserProvider

    private static double indexingTime;
   
    @BeforeClass
    public static void readTestData() throws IOException {
        //add the metadata
        ParsingProvider parser = new JenaParserProvider();
        //create the content Item with the HTML content
        MGraph rdfData = parseRdfData(parser,"example.rdf.zip");
        UriRef contentItemId = null;
        Iterator<Triple> it = rdfData.filter(null, Properties.ENHANCER_EXTRACTED_FROM, null);
        while(it.hasNext()){
View Full Code Here

Examples of org.apache.clerezza.rdf.jena.parser.JenaParserProvider

    private ContentItemBackend backend;
    private LDPath<Resource> ldpath;
    @BeforeClass
    public static void readTestData() throws IOException {
        //add the metadata
        ParsingProvider parser = new JenaParserProvider();
        //create the content Item with the HTML content
        MGraph rdfData = parseRdfData(parser,"metadata.rdf.zip");
        UriRef contentItemId = null;
        Iterator<Triple> it = rdfData.filter(null, Properties.ENHANCER_EXTRACTED_FROM, null);
        while(it.hasNext()){
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.