Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.ValueFactoryImpl.createURI()


  public Resource export(Model model) {
    Resource implNode = super.export(model);
    ValueFactoryImpl vf = ValueFactoryImpl.getInstance();

    if (url != null) {
      model.add(implNode, REPOSITORYURL, vf.createURI(url));
    }
    if (readOnly) {
      model.add(implNode, READ_ONLY, vf.createLiteral(readOnly));
    }
    for (String space : subjectSpace) {
View Full Code Here


    }
    if (readOnly) {
      model.add(implNode, READ_ONLY, vf.createLiteral(readOnly));
    }
    for (String space : subjectSpace) {
      model.add(implNode, SUBJECTSPACE, vf.createURI(space));
    }
    // if (username != null) {
    // graph.add(implNode, USERNAME,
    // graph.getValueFactory().createLiteral(username));
    // }
View Full Code Here

        Resource subject;
        URI predicate;
        Value object;
        if (triple.getSubject() instanceof RDFResourceIRI) {
            try {
                subject = vf.createURI(triple.getSubject().getIRI().toString());
            } catch (IllegalArgumentException iae) {
                LOGGER.error("Subject URI was invalid: {}", triple);
                return Collections.emptyList();
            }
        } else {
View Full Code Here

            } else {
                subject = vf.createBNode(triple.getSubject().getIRI()
                        .toString());
            }
        }
        predicate = vf.createURI(triple.getPredicate().getIRI().toString());
        if (triple.getObject() instanceof RDFResourceIRI) {
            try {
                object = vf.createURI(triple.getObject().getIRI().toString());
            } catch (IllegalArgumentException iae) {
                LOGGER.error("Object URI was invalid: {}", triple);
View Full Code Here

            }
        }
        predicate = vf.createURI(triple.getPredicate().getIRI().toString());
        if (triple.getObject() instanceof RDFResourceIRI) {
            try {
                object = vf.createURI(triple.getObject().getIRI().toString());
            } catch (IllegalArgumentException iae) {
                LOGGER.error("Object URI was invalid: {}", triple);
                return Collections.emptyList();
            }
        } else if (triple.getObject() instanceof RDFLiteral) {
View Full Code Here

                } else {
                    object = vf.createLiteral(literalObject.getLexicalValue());
                }
            } else {
                object = vf.createLiteral(literalObject.getLexicalValue(),
                        vf.createURI(literalObject.getDatatype().toString()));
            }
        } else {
            // FIXME: When blank nodes are no longer represented as IRIs
            // internally, need to fix
            // this
View Full Code Here

    @Test
    public void testLinkExtraction() throws RepositoryException {
        assertExtract("/html/html-head-link-extractor.html");
        assertModelNotEmpty();
        final ValueFactory valueFactory = new ValueFactoryImpl();
        final URI externalLinkURI = valueFactory.createURI("http://www.myexperiment.org/workflows/16.rdf");
        assertContains(
                AbstractExtractorTestCase.baseURI,
                valueFactory.createURI("http://www.w3.org/1999/xhtml/vocab#alternate"),
                externalLinkURI
View Full Code Here

        assertModelNotEmpty();
        final ValueFactory valueFactory = new ValueFactoryImpl();
        final URI externalLinkURI = valueFactory.createURI("http://www.myexperiment.org/workflows/16.rdf");
        assertContains(
                AbstractExtractorTestCase.baseURI,
                valueFactory.createURI("http://www.w3.org/1999/xhtml/vocab#alternate"),
                externalLinkURI

        );
        assertContains(
                externalLinkURI,
View Full Code Here

                externalLinkURI

        );
        assertContains(
                externalLinkURI,
                valueFactory.createURI("http://purl.org/dc/terms/title"),
                valueFactory.createLiteral("RDF+XML")

        );
        assertContains(
                externalLinkURI,
View Full Code Here

                valueFactory.createLiteral("RDF+XML")

        );
        assertContains(
                externalLinkURI,
                valueFactory.createURI("http://purl.org/dc/terms/format"),
                valueFactory.createLiteral("application/rdf+xml")

        );
    }
}
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.