Package org.ontoware.rdf2go.model.node.impl

Examples of org.ontoware.rdf2go.model.node.impl.PlainLiteralImpl


  public void testNotificationOnLiteralObject() {
    this.notifyingModel.open();
    ModelChangedListener listener = new AbstractModelChangeListener() {
      @Override
      public void addedStatement(Statement statement) {
        assertEquals(new PlainLiteralImpl("Sebastian"), statement
            .getObject());
      }
    };
    this.notifyingModel.addModelChangedListener(listener,
        new TriplePatternImpl(Variable.ANY, Variable.ANY,
            new PlainLiteralImpl("Sebastian")));
    this.notifyingModel.addStatement(subject, predicate, "Sebastian Gerke");
    this.notifyingModel.addStatement(predicate, object, "Sebastian");
    this.notifyingModel.close();
  }
View Full Code Here


    this.notifyingModel.open();
    ModelChangedListener listener = new AbstractModelChangeListener() {
      @Override
      public void addedStatement(Statement statement) {
        System.out.println(statement.getObject().getClass());
        assertEquals(new PlainLiteralImpl("Sebastian"), statement
            .getObject());
        assertEquals(predicate, statement.getPredicate());
      }
    };
    this.notifyingModel.addModelChangedListener(listener,
        new TriplePatternImpl(Variable.ANY, predicate,
            new PlainLiteralImpl("Sebastian")));
    this.notifyingModel.addStatement(subject, predicate, "Sebastian Gerke");
    this.notifyingModel.addStatement(subject, predicate, "Sebastian");
    this.notifyingModel.addStatement(predicate, object, "Sebastian");
    this.notifyingModel.close();
  }
View Full Code Here

      // language tagged
      if(lit.language() != null && !lit.language().equals(""))
        return new LanguageTagLiteralImpl(lit.getLexicalForm(), lit.language());
     
      // plain
      return new PlainLiteralImpl(lit.getLexicalForm());
    }
   
    if(n.isBlank())
      return new JenaBlankNode(n);
   
View Full Code Here

    if(language != null) {
      return new LanguageTagLiteralImpl(label, language);
    } else if(dataType != null) {
      return new DatatypeLiteralImpl(label, new URIImpl(dataType.toString(), false));
    } else {
      return new PlainLiteralImpl(label);
    }
  }
View Full Code Here

      public void addedStatement(Statement statement)
      {
        assertEquals(context1, statement.getContext());
        assertEquals(subject, statement.getSubject());
        assertEquals(predicate, statement.getPredicate());
        assertEquals(new PlainLiteralImpl("Sebastian Gerke"), statement.getObject());
      }
    };
    QuadPattern pattern = new QuadPatternImpl(Variable.ANY, Variable.ANY, Variable.ANY, new PlainLiteralImpl("Sebastian Gerke"));
    this.model.addModelSetChangedListener(listener, pattern);
    this.model.open();
    this.model.addStatement(context1, subject, predicate, new PlainLiteralImpl("Sebastian Gerke"));
    this.model.close();
  }
View Full Code Here

 
 
  public void testLiteralNotification2()
  {
    ModelChangedListener listener = new AbstractModelChangeListener() {};
    QuadPattern pattern = new QuadPatternImpl(Variable.ANY, Variable.ANY, Variable.ANY, new PlainLiteralImpl("Sebastian"));
    this.model.addModelSetChangedListener(listener, pattern);
    this.model.open();
    this.model.addStatement(context1, subject, predicate, new PlainLiteralImpl("Sebastian Gerke"));
    this.model.close();
  }
View Full Code Here

   * @param object never null
   */
  public TriplePatternImpl(ResourceOrVariable subject, URI predicate, String object) {
    this.subject = subject;
    this.predicate = predicate;
    this.object = new PlainLiteralImpl(object);
  }
View Full Code Here

   */
  @Override
  public boolean contains(ResourceOrVariable subject, UriOrVariable predicate, String plainLiteral)
          throws ModelRuntimeException {
    assertModel();
    return contains(subject, predicate, new PlainLiteralImpl(plainLiteral));
  }
View Full Code Here

    return new LanguageTagLiteralImpl(literal, languageTag);
  }
 
  @Override
  public PlainLiteral createPlainLiteral(String literal) throws ModelRuntimeException {
    return new PlainLiteralImpl(literal);
  }
View Full Code Here

  }

  @Override
    public void addStatement(Resource subject, URI predicate, String literal)
      throws ModelRuntimeException {
    addStatement(subject, predicate, new PlainLiteralImpl(literal));
  }
View Full Code Here

TOP

Related Classes of org.ontoware.rdf2go.model.node.impl.PlainLiteralImpl

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.