Package org.openrdf.model

Examples of org.openrdf.model.Model.subjects()


            Model model = Rio.parse(data, "", RDFFormat.RDFJSON);
           
            // convert Sesame Model into a map to Metadata objects
            Map<String,Metadata> result = new HashMap<String, Metadata>();
           
            for(Resource subject : model.subjects()) {
                Metadata m = new Metadata(subject.stringValue());
                for(org.openrdf.model.URI property : model.filter(subject, null, null).predicates()) {
                    Set<RDFNode> propValue = new HashSet<RDFNode>();
                    for(Value value : model.filter(subject, property, null).objects()) {
                        propValue.add(parseRDFJSONNode(value));
View Full Code Here


        assertEquals("Unexpected number of statements", 6, model.size());
        final Model bnodeModel = model.filter(null, uri1,
                vf.createLiteral(plainLit.getLabel(), XMLSchema.STRING));
        assertEquals("Blank node was not round-tripped", 1, bnodeModel.size());
        assertTrue("Blank node was not round-tripped as a blank node", bnodeModel.subjects()
                .iterator().next() instanceof BNode);
        if (rdfParser.getRDFFormat().supportsContexts()) {
            assertTrue(model.contains(st2));
        } else {
            assertTrue(model.contains(vf.createStatement(uri1, uri2, langLit)));
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.