Package org.apache.stanbol.entityhub.servicesapi.model

Examples of org.apache.stanbol.entityhub.servicesapi.model.ValueFactory.createReference()


        assertFalse(refs.hasNext());
        // test multiple adds do not generate duplicate References
        rep.add(field, url);
        assertTrue(asCollection(rep.get(field)).size() == 1);
        // test adding a equivalent reference
        rep.add(field, vf.createReference(url.toString()));
        assertTrue(asCollection(rep.get(field)).size() == 1);
        // test removing
        rep.remove(field, url);
        assertFalse(rep.get(field).hasNext());
View Full Code Here


    @Test
    public void testMultipleAddAndRemove() throws MalformedURLException, URISyntaxException {
        String field = "urn:the.field:used.for.this.Test";
        ValueFactory vf = getValueFactory();
        Representation rep = createRepresentation(null);
        Reference ref = vf.createReference("http://www.test.org/test");
        Text text = vf.createText("test", "en");
        Integer i = 42;
        Double d = Math.PI;
        URI uri = new URI("http://www.test.org/uriTest");
        URL url = new URL("http://www.test.org/urlTest");
View Full Code Here

     *            the object representing the reference
     * @return the created {@link Reference} that can be used to perform further tests.
     */
    private Reference testRef(Object refObject) {
        ValueFactory vf = getValueFactory();
        Reference ref = vf.createReference(refObject);
        // check not null
        assertNotNull(ref);
        // check reference is not null
        assertNotNull(ref.getReference());
        return ref;
View Full Code Here

            siteMetadata.put(NamespaceEnum.cc.getNamespace()+"attributionName",
                vf.createText(siteConfiguration.getAttribution()));
        }
        if(siteConfiguration.getAttributionUrl() != null){
            siteMetadata.put(NamespaceEnum.cc.getNamespace()+"attributionURL",
                vf.createReference(siteConfiguration.getAttributionUrl()));
        }
        //add the licenses
        if(siteConfiguration.getLicenses() != null){
            for(License license : siteConfiguration.getLicenses()){
                if(license.getUrl() != null){
View Full Code Here

        //add the licenses
        if(siteConfiguration.getLicenses() != null){
            for(License license : siteConfiguration.getLicenses()){
                if(license.getUrl() != null){
                    siteMetadata.put(NamespaceEnum.cc.getNamespace()+"license",
                        vf.createReference(license.getUrl()));
                } else if(license.getText() != null){
                    siteMetadata.put(NamespaceEnum.cc.getNamespace()+"license",
                        vf.createText(license.getText()));
                }
                //if defined add the name to dc:license
View Full Code Here

     */
    @Test
    public void testRemovalOfTypeRepresentationStatement() throws YardException {
        Yard yard = getYard();
        ValueFactory vf = yard.getValueFactory();
        Reference representationType = vf.createReference(RdfResourceEnum.Representation.getUri());
        Representation test = create();
        //the rdf:type Representation MUST NOT be within the Representation
        Assert.assertFalse(test.get(RDF.type.getUnicodeString()).hasNext());
        //now add the statement and see if an IllegalStateException is thrown
        /*
 
View Full Code Here

            return Collections.emptyMap();
        }

        Representation representation;
        for (String context : contexts) {
            representation = ldPath.execute(vf.createReference(context), program);
            Iterator<String> fieldNames = representation.getFieldNames();
            while (fieldNames.hasNext()) {
                String fieldName = fieldNames.next();
                Iterator<Object> valueIterator = representation.get(fieldName);
                Set<Object> values = new HashSet<Object>();
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.