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

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


    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");
        String[] textAsArray = new String[] {"Test text as Array", "en"};
View Full Code Here


     *            the language
     * @return the created {@link Text} instance that can be used to perform further tests.
     */
    private Text testText(String textString, String language) {
        ValueFactory vf = getValueFactory();
        Text text = vf.createText(textString, language);
        assertNotNull(text.getText());
        assertNotNull(text.getText());
        assertEquals(text.getText(), textString);
        if (language == null) {
            assertTrue(text.getLanguage() == null);
View Full Code Here

        log.info(" > initialise Referenced Site {}",siteConfiguration.getName());
        siteMetadata = new HashMap<String,Object>();
        ValueFactory vf = InMemoryValueFactory.getInstance();
        if(siteConfiguration.getAttribution() != null){
            siteMetadata.put(NamespaceEnum.cc.getNamespace()+"attributionName",
                vf.createText(siteConfiguration.getAttribution()));
        }
        if(siteConfiguration.getAttributionUrl() != null){
            siteMetadata.put(NamespaceEnum.cc.getNamespace()+"attributionURL",
                vf.createReference(siteConfiguration.getAttributionUrl()));
        }
View Full Code Here

                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
                if(license.getName() != null){
                    siteMetadata.put(NamespaceEnum.dcTerms.getNamespace()+"license",
                        vf.createText(license.getName()));
View Full Code Here

                        vf.createText(license.getText()));
                }
                //if defined add the name to dc:license
                if(license.getName() != null){
                    siteMetadata.put(NamespaceEnum.dcTerms.getNamespace()+"license",
                        vf.createText(license.getName()));
                }
                //link to the license via cc:license
            }
        }
       
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.