Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.URIImpl


      repository.initialize();
    } catch (RepositoryException e) {
      throw new RuntimeException(e);
    }
   
    URI p = new URIImpl("urn:rel:p");
    URI q = new URIImpl("urn:rel:q");
    URI nrlInverse = ForwardChainingRDFSPlusInverseInferencerConnection.NRL_InverseProperty;
    URI defaultContext = null; // new Resource[0]

    RepositoryConnection con = repository.getConnection();
View Full Code Here


      repository.initialize();
    } catch (RepositoryException e) {
      throw new RuntimeException(e);
    }
   
    URI a1 = new URIImpl("urn:name:a1");
    URI b1 = new URIImpl("urn:name:b1");
    URI relA = new URIImpl("urn:rel:A");
    URI relAinv= new URIImpl("urn:rel:Ainv");
    URI nrlInverse = ForwardChainingRDFSPlusInverseInferencerConnection.NRL_InverseProperty;
    URI defaultContext = null; // new Resource[0]

    RepositoryConnection con = repository.getConnection();
    con.add(a1,relA,b1);
View Full Code Here

    private class FullParseScenarioRDFHandler extends TestRDFHandler {

        public void handleStatement(Statement statement) throws RDFHandlerException {
            int statementIndex = getStatements().size();
            if(statementIndex == 0){
                Assert.assertEquals(new URIImpl("http://example.org/alice/foaf.rdf#me"), statement.getSubject() );
            } else {
                Assert.assertTrue(statement.getSubject() instanceof BNode);
            }

            if( statementIndex == 4) {
                Assert.assertEquals(new URIImpl("http://test.base.uri#like"), statement.getPredicate() );
            }

            if(statementIndex == 5) {
                Assert.assertNull(statement.getContext());
            } else {
                Assert.assertEquals(
                        new URIImpl(String.format("http://example.org/alice/foaf%s.rdf", statementIndex + 1)),
                        statement.getContext()
                );
            }

            super.handleStatement(statement);
View Full Code Here

    private URI extractProfile(Document in) {
        String profile = DomUtils.find(in, "string(/HTML/@profile)");
        if (profile.equals("")) {
            return null;
        }
        return new URIImpl(profile);
    }
View Full Code Here

        for(Node linkNode : linkNodes) {
            NamedNodeMap attributes = linkNode.getAttributes();
            String rel = attributes.getNamedItem("rel").getTextContent();
            String href = attributes.getNamedItem("href").getTextContent();
            if(rel != null && href !=null && RDFUtils.isAbsoluteURI(href)) {
                prefixes.put(rel, new URIImpl(href));
            }
        }
    }
View Full Code Here

            String name = nameAttribute.getTextContent();
            String content = contentAttribute.getTextContent();
            String xpath = DomUtils.getXPathForNode(metaNode);
            URI nameAsURI = getPrefixIfExists(name);
            if (nameAsURI == null) {
                nameAsURI = new URIImpl(baseProfile + name);
            }
            Meta meta = new Meta(xpath, nameAsURI, content);
            result.add(meta);
        }
        return result;
View Full Code Here

    }

    private URI getPrefixIfExists(String name) {
        String[] split = name.split("\\.");
        if(split.length == 2 && prefixes.containsKey(split[0])) {
            return new URIImpl(prefixes.get(split[0]) + split[1]);
        }
        return null;
    }
View Full Code Here

    private void addExtractionTimeSizeMetaTriples(ExtractionContext context)
    throws TripleHandlerException {
        // adding extraction date
        String xsdDateTimeNow = RDFUtils.toXSDDateTime(new Date());
        output.receiveTriple(
                new URIImpl(documentURI.toString()),
                vSINDICE.getProperty(SINDICE.DATE),
                ValueFactoryImpl.getInstance().createLiteral(xsdDateTimeNow),
                null,
                context
        );

        // adding number of extracted triples
        int numberOfTriples = 0;
        CompositeTripleHandler cth = (CompositeTripleHandler) output;
        for (TripleHandler th : cth.getChilds()) {
            if (th instanceof CountingTripleHandler) {
                numberOfTriples = ((CountingTripleHandler) th).getCount();
            }
        }
        output.receiveTriple(
                new URIImpl(documentURI.toString()),
                vSINDICE.getProperty(SINDICE.SIZE),
                ValueFactoryImpl.getInstance().createLiteral(numberOfTriples + 1), // the number of triples plus itself
                null,
                context
        );
View Full Code Here

                    null
            );
        } else {
            URI literalType = null;
            try {
                literalType = new URIImpl(lt.value);
            } catch (Exception e) {
                reportError( String.format("Error while parsing literal type '%s'", lt.value), row, col );
            }
            return createLiteral(
                    validateAndNormalizeLiteral(value, literalType),
View Full Code Here

                RDFUtils.uri("http://gra2")
        );
        Statement s5 = RDFUtils.quad(
                RDFUtils.getBNode("5"),
                RDFUtils.uri("http://pre"),
                RDFUtils.literal("12345", new URIImpl("http://www.w3.org/2001/XMLSchema#integer")),
                RDFUtils.uri("http://gra2")
        );
        Statement s6 = RDFUtils.quad(
                RDFUtils.uri("p1:sub"),
                RDFUtils.uri("p1:pre"),
View Full Code Here

TOP

Related Classes of org.openrdf.model.impl.URIImpl

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.