Package com.hp.hpl.jena.datatypes

Examples of com.hp.hpl.jena.datatypes.BaseDatatype$TypedValue


    if (type==null) return null;
    TypeMapper tm = TypeMapper.getInstance();
    RDFDatatype dt = tm.getTypeByName(type);
    if (dt == null) {
      // we've got a new (derived) datatype here
      dt = new BaseDatatype(type);
      tm.registerDatatype(dt);
    }
    return dt;
  }
View Full Code Here


    URI testA = new URIImpl("test://somedata-A", false);
    // die zweite DatenTyp URI
    URI testB = new URIImpl("test://somedata-B", false);
   
    // der erste BaseDatatype wird von der ersten DatenTyp URI erzeugt
    BaseDatatype BDtestA1 = new BaseDatatype(testA + "");
    // der zweite BaseDatatype ebenso
    BaseDatatype BDtestA2 = new BaseDatatype(testA + "");
    // f�r den dritten BaseDatatype nehmen wir eine neue Datentyp URI
    BaseDatatype BDtestB = new BaseDatatype(testB + "");
   
    // alle Literals haben den gleichen Inhalt
   
    // das erste Literal kriegt den ersten BaseDatatype
    LiteralLabel litA11 = LiteralLabelFactory.create("teststring", "", BDtestA1);
View Full Code Here

    case "ol":
        if (i + 1 < k.size()) // check if not out of bounds
      switch (k.get(i + 1))
      {
          case "lt":
        object = model.createTypedLiteral(v.get(i), new BaseDatatype(v.get(i + 1))); // typed literal (value+datatype)
        i++; // skip the following "lt"
        break;
          case "ll":
        object = model.createLiteral(v.get(i), v.get(i + 1)); // literal with language (value+lang)
        i++; // skip the following "ll"
        break;
          default:
        object = model.createLiteral(v.get(i)); // plain literal (if not followed by lang or datatype)
        break;
      }
        else
      object = model.createLiteral(v.get(i)); // plain literal
        break;
    case "lt":
        if (i + 1 < k.size() && k.get(i + 1).equals("ol")) // followed by "ol" (if not out of bounds)
        {
      object = model.createTypedLiteral(v.get(i + 1), new BaseDatatype(v.get(i))); // typed literal (datatype+value)
      i++; // skip the following "ol"
        }
        break;
    case "ll":
        if (i + 1 < k.size() && k.get(i + 1).equals("ol")) // followed by "ol" (if not out of bounds)
View Full Code Here

    add(expected.createResource("http://subject1"), expected.createProperty("http://predicate1"), expected.createResource("http://object1")).
    add(expected.createResource("http://subject1"), expected.createProperty("http://predicate2"), expected.createResource("http://object2")).
    add(expected.createResource("http://subject1"), expected.createProperty("http://predicate2"), expected.createResource("http://object3")).
    add(expected.createResource("http://subject2"), expected.createProperty("http://predicate3"), expected.createLiteral("literal1")).
    add(expected.createResource("http://subject3"), expected.createProperty("http://predicate4"), expected.createLiteral("literal2", "da")).
    add(expected.createResource("http://subject4"), expected.createProperty("http://predicate5"), expected.createTypedLiteral("literal3", new BaseDatatype("http://type"))).
    add(expected.createResource("http://subject4"), expected.createProperty("http://dct.org/#hasPart"), expected.createResource(AnonId.create("b1"))).
    add(expected.createResource(AnonId.create("b1")), expected.createProperty("http://rdf.org/#first"), expected.createResource("http://something/")).
    add(expected.createResource(AnonId.create("b1")), expected.createProperty("http://rdf.org/#rest"), expected.createResource("http://rdf.org/#nil"));
  System.out.println("Expected Model");
  System.out.println(expected.listStatements().toList().toString());
View Full Code Here

        }
    }

    @Override
    public final void addTypedLiteral(String subj, String pred, String content, String type) {
        Node literal = Node.createLiteral(content, "", new BaseDatatype(type));
        addTriple(convertNonLiteral(subj), Node.createURI(pred), literal);
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.datatypes.BaseDatatype$TypedValue

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.