Examples of PlainLiteral


Examples of net.fortytwo.twitlogic.model.PlainLiteral

    private void produceGender(final Gender gender,
                               final AfterthoughtContext context) throws MatcherException {
        try {
            context.handleCompletedTriple(new URIReference(FOAF.GENDER),
                    new PlainLiteral(gender.toString()));
        } catch (HandlerException e) {
            throw new MatcherException(e);
        }
    }
View Full Code Here

Examples of net.fortytwo.twitlogic.model.PlainLiteral

                    && rating <= maxRating) {
                Resource review = context.anonymousNode();
                try {
                    context.handle(new Triple(context.getSubject(), HASREVIEW, review));
                    context.handle(new Triple(review, TYPE, REVIEW));
                    context.handle(new Triple(review, RATING, new PlainLiteral("" + rating)));
                    context.handle(new Triple(review, MAXRATING, new PlainLiteral("" + maxRating)));
                    context.handle(new Triple(review, MINRATING, new PlainLiteral("" + minRating)));
                    context.handle(new Triple(review, TEXT, new PlainLiteral(context.thisTweet().getText())));
                } catch (HandlerException e) {
                    throw new MatcherException(e);
                }

                // FIXME: restore this.  Currently, it causes a transaction to hang.
View Full Code Here

Examples of net.fortytwo.twitlogic.model.PlainLiteral

        if (2 == a.length && 0 == a[0].length()) {
            String v = a[1].trim();
            if (0 < v.length()) {
                try {
                    context.handleCompletedTriple(new URIReference(propertyURI()),
                            new PlainLiteral(v));
                } catch (HandlerException e) {
                    throw new MatcherException(e);
                }
            }
        }
View Full Code Here

Examples of net.fortytwo.twitlogic.model.PlainLiteral

        assertExpected("@joshsh #knows @xixiluo",
                new Triple(JOSHSH, KNOWS, XIXILUO));
        assertExpected("@joshsh #knows #xixiluo",
                new Triple(JOSHSH, KNOWS, new Hashtag("xixiluo")));
        assertExpected("@joshsh #knows \"xixiluo\"",
                new Triple(JOSHSH, KNOWS, new PlainLiteral("xixiluo")));
        assertExpected("@joshsh #knows http://example.org/xixiluo",
                new Triple(JOSHSH, KNOWS, new TypedLiteral("http://example.org/xixiluo", XMLSchema.NAMESPACE + "anyURI")));
    }
View Full Code Here

Examples of net.fortytwo.twitlogic.model.PlainLiteral

                new Triple(JOSHSH_PERSON, KNOWS, new User("XixiLuo").getHeldBy()));
    }

    public void testDatatypeProperty() throws Exception {
        assertExpected("@joshsh (phone +1 555 123 4567)",
                new Triple(JOSHSH_PERSON, PHONE, new PlainLiteral("+1 555 123 4567")));
        assertExpected("@joshsh (phone number +1 555 123 4567)",
                new Triple(JOSHSH_PERSON, PHONE, new PlainLiteral("+1 555 123 4567")));
    }
View Full Code Here

Examples of net.fortytwo.twitlogic.model.PlainLiteral

    public void testAll() throws Exception {
        Resource review = bnode(bnodeIndex + 1);
        assertExpected("IMHO, #thebestmovieever (3/5) is only so-so.",
                new Triple(THEBESTMOVIEEVER, HASREVIEW, review),
                new Triple(review, TYPE, REVIEW),
                new Triple(review, RATING, new PlainLiteral("3")),
                new Triple(review, MAXRATING, new PlainLiteral("5")),
                new Triple(review, MINRATING, new PlainLiteral("0")),
                // FIXME: restore this once the corresponding statement is restored in ReviewMatcher
          //      new Triple(review, REVIEWER, tweetContext.thisPerson()),
                new Triple(review, TEXT, new PlainLiteral("IMHO, #thebestmovieever (3/5) is only so-so.")));
    }
View Full Code Here

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

        readLock.lock();
        try {
          Iterator<Triple> values = contentGraph.filter(contentUser,
              property, null);
          while (values.hasNext()) {
            PlainLiteral value = (PlainLiteral) values.next().getObject();
            resultGraph.add(new TripleImpl(customfield,
                CUSTOMPROPERTY.actualvalues, value));
          }
        } finally {
          readLock.unlock();
View Full Code Here

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

  @Override
  public boolean equals(Object otherObj) {
    if (!(otherObj instanceof PlainLiteral)) {
      return false;
    }
    PlainLiteral other = (PlainLiteral) otherObj;
    if (!lexicalForm.equals(other.getLexicalForm())) {
      return false;
    }
    if (language != null) {
      return language.equals(other.getLanguage());
    }
    if (other.getLanguage() != null) {
      return false;
    }
    return true;
  }
View Full Code Here

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

      readLock.lock();
    }
    try {
      Iterator<Resource> labels = resource.getObjects(RDFS.label);
      while (labels.hasNext()) {
        PlainLiteral label = (PlainLiteral) labels.next();
        if (label.getLanguage().equals(lang)) {
          return label.getLexicalForm();
        }
      }
      return null;
    } finally {
      if (readLock != null) {
View Full Code Here

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

    Iterator<Triple> languages = lingvojGraph.filter(null, RDFS.isDefinedBy, null);
    while (languages.hasNext()) {
      GraphNode languageNode = new GraphNode((UriRef) languages.next().getSubject(), lingvojGraph);
      Iterator<Resource> labels = languageNode.getObjects(RDFS.label);
      while (labels.hasNext()) {
        PlainLiteral label = (PlainLiteral) labels.next();
        if (label.getLanguage().equals(inLanguage) || inLanguage == null) {
          if (label.getLexicalForm().contains(languageName)) {
            return (UriRef) languageNode.getNode();
          }
        }
      }
    }
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.