Package org.apache.clerezza.rdf.core

Examples of org.apache.clerezza.rdf.core.PlainLiteral


    return AccessController.doPrivileged(new PrivilegedAction<Object>() {
      @Override
      public Object run() {
        GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
        result.addProperty(RDF.type, LOGIN.LoginPage);
        PlainLiteral failedMessage = new PlainLiteralImpl(
            "Username name or password are wrong");
        try {
          if (authenticationService.authenticateUser(userName,password)) {
            Set<LoginListener> tempLoginListenerSet = null;
            synchronized(loginListenerSet) {
View Full Code Here


   * @return permission node
   */
  private NonLiteral getPermissionOfAJavaPermEntry(
      String permissionString) {
    LockableMGraph systemGraph = getSystemGraph();
    PlainLiteral javaPermEntry = new PlainLiteralImpl(permissionString);
    Lock readLock = systemGraph.getLock().readLock();
    readLock.lock();
    try {
      Iterator<Triple> javaPermTriples = systemGraph.filter(null,
          PERMISSION.javaPermissionEntry, javaPermEntry);
View Full Code Here

      sb.append("^^<");
      escapeUtf8ToUsAscii(
          typedLiteral.getDataType().getUnicodeString(), sb, false);
      sb.append(">");
    } else if(literal instanceof PlainLiteral) {
      PlainLiteral plainLiteral = (PlainLiteral) literal;
      if(plainLiteral.getLanguage() != null &&
          !plainLiteral.getLanguage().toString().equals("")) {

        sb.append("@");
        sb.append(plainLiteral.getLanguage().toString());
      }
    }

    sb.append(" ");
View Full Code Here

        if (random <= i) {
          mGraph.add(new TripleImpl(subject, predicate, lf.createTypedLiteral(count)));
        } else if (random <= d) {
          mGraph.add(new TripleImpl(subject, predicate, lf.createTypedLiteral(random)));
        } else {
          PlainLiteral text;
          if (random <= i) {
            text = new PlainLiteralImpl("Literal for " + count);
          } else if (random <= d) {
            text = new PlainLiteralImpl("An English literal for " + count, EN);
          } else {
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  private JSONObject writeObject(BNodeManager bNodeMgr, Resource object) {
    JSONObject jObject = new JSONObject();
    if (object instanceof PlainLiteral) {
      PlainLiteral plainLiteral = (PlainLiteral) object;
      jObject.put("value", plainLiteral.getLexicalForm());
      jObject.put("type", "literal");
      if (plainLiteral.getLanguage() != null) {
        jObject.put("lang", plainLiteral.getLanguage().toString());
      }
    } else if (object instanceof TypedLiteral) {
      TypedLiteral literal = (TypedLiteral) object;
      jObject.put("value", literal.getLexicalForm());
      jObject.put("type", "literal");
View Full Code Here

        public String getSummary() {
            Iterator<Triple> abstracts = entityProperties.filter(uri, SUMMARY, null);
            while (abstracts.hasNext()) {
                Resource object = abstracts.next().getObject();
                if (object instanceof PlainLiteral) {
                    PlainLiteral abstract_ = (PlainLiteral) object;
                    if (new Language("en").equals(abstract_.getLanguage())) {
                        return abstract_.getLexicalForm();
                    }
                }
            }
            return "";
        }
View Full Code Here

        public String getSummary() {
            Iterator<Triple> abstracts = entityProperties.filter(uri, SUMMARY, null);
            while (abstracts.hasNext()) {
                Resource object = abstracts.next().getObject();
                if (object instanceof PlainLiteral) {
                    PlainLiteral abstract_ = (PlainLiteral) object;
                    if (new Language("en").equals(abstract_.getLanguage())) {
                        return abstract_.getLexicalForm();
                    }
                }
            }
            return "";
        }
View Full Code Here

                if (random <= i) {
                    tc.add(new TripleImpl(subject, predicate, lf.createTypedLiteral(count)));
                } else if (random <= d) {
                    tc.add(new TripleImpl(subject, predicate, lf.createTypedLiteral(random)));
                } else {
                    PlainLiteral text;
                    if (random <= i) {
                        text = new PlainLiteralImpl("Literal for " + count);
                    } else if (random <= d) {
                        text = new PlainLiteralImpl("An English literal for " + count, EN);
                    } else {
View Full Code Here

                   
                    String strValue = currentTriple.getObject().toString();
                    JsonLdPropertyValue jldValue = new JsonLdPropertyValue();

                    if (currentTriple.getObject() instanceof PlainLiteral) {
                        PlainLiteral plain = (PlainLiteral) currentTriple.getObject();
                        if (plain.getLanguage() != null) {
                            jldValue.setLanguage(plain.getLanguage().toString());
                        }
                        strValue = plain.getLexicalForm();
                    }
                    else if (currentTriple.getObject() instanceof TypedLiteral) {
                        TypedLiteral typedObject = (TypedLiteral) currentTriple.getObject();
                        String type = typedObject.getDataType().getUnicodeString();
                        jldValue.setType(type);
View Full Code Here

        }

        // filter appears to see plain literals and xsd:strings as differerent
        // so not
        // userNode.addPropertyValue(predicate, newValue);
        PlainLiteral newObject = new PlainLiteralImpl(newValue);
        userNode.addProperty(predicate, newObject);

        if (newObject.equals(oldObject)) {
            return;
        }
        systemGraph.removeAll(oldBuffer);
    }
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.PlainLiteral

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.