Examples of Literal


Examples of com.hp.hpl.jena.rdf.model.Literal

      Resource sourceRes = metaModel.createResource(source.getURIRef());
      ResIterator assertions = metaModel.listSubjectsWithProperty(
          METAMODEL.asserter, sourceRes);
      while (assertions.hasNext()) {
        Resource assertion = assertions.nextResource();
        Literal assertionTimeLit = assertion.getProperty(
            METAMODEL.assertionTime).getLiteral();
        Resource assertedComponent = assertion.getProperty(
            METAMODEL.assertedComponent).getResource();
        if (!assertedComponent.hasProperty(RDF.type, type)) {
          continue;
        }

        Date assertionTime;
        assertionTime = ((XSDDateTime) assertionTimeLit.getValue())
            .asCalendar().getTime();
        /*
         * try { assertionTime = new MillisDateFormat()
         * .parse(assertionTimeLit.getLexicalForm()); } catch
         * (ParseException e) { throw new RuntimeException(e); }
         */
        if (moment.before(assertionTime)) {
          continue;
        }
        Statement revocationTimeStmt = assertion
            .getProperty(METAMODEL.revocationTime);
        if (revocationTimeStmt != null) {
          Literal revocationTimeLit = revocationTimeStmt.getLiteral();
          Date revocationTime = ((XSDDateTime) revocationTimeLit
              .getValue()).asCalendar().getTime();
          // not before rather than after as in the moment of
          // revocation it is revoked
          if (!moment.before(revocationTime)) {
            continue;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Literal

    if (revokingComponentRes == null) {
      throw new StoreException("Assertion not found");
    }
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(moment);
    Literal momentLit = metaModel.createTypedLiteral(new XSDDateTime(
        calendar));
    /*
     * Literal momentLit = metaModel.createTypedLiteral( new
     * MillisDateFormat().format(moment), XSDDatatype.XSDdateTime);
     */
 
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Literal

    while (assertionsOfComponent.hasNext()) {
      Resource assertion = assertionsOfComponent.nextResource();
      if (!assertion.hasProperty(METAMODEL.asserter, sourceRes)) {
        continue;
      }
      Literal assertionTimeLit = assertion.getProperty(
          METAMODEL.assertionTime).getLiteral();
      Date assertionTime;
      assertionTime = ((XSDDateTime) assertionTimeLit.getValue())
          .asCalendar().getTime();

      if (moment.before(assertionTime)) {
        continue;
      }
      Statement revocationTimeStmt = assertion
          .getProperty(METAMODEL.revocationTime);
      if (revocationTimeStmt != null) {
        Literal revocationTimeLit = revocationTimeStmt.getLiteral();
        Date revocationTime = ((XSDDateTime) revocationTimeLit
            .getValue()).asCalendar().getTime();

        // not before rather than after as in the moment of
        // revocation it is revoked
        if (!moment.before(revocationTime)) {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Literal

      Resource sourceRes = metaModel.createResource(source.getURIRef());
      ResIterator assertions = metaModel.listSubjectsWithProperty(
          METAMODEL.asserter, sourceRes);
      while (assertions.hasNext()) {
        Resource assertion = assertions.nextResource();
        Literal assertionTimeLit = assertion.getProperty(
            METAMODEL.assertionTime).getLiteral();
        Date assertionTime;
        try {
          assertionTime = ((XSDDateTime) assertionTimeLit.getValue())
              .asCalendar().getTime();
          /*
           * assertionTime = new MillisDateFormat()
           * .parse(assertionTimeLit.getLexicalForm());
           */
        } catch (/* Parse */Exception e) {
          throw new RuntimeException(e);
        }
        if (forward) {
          if (assertionTime.after(moment)) {
            resultDateSet.add(assertionTime);
          }
        } else {
          if (!assertionTime.after(moment)) {
            resultDateSet.add(assertionTime);
          }
        }
        Statement revocationTimeStmt = assertion
            .getProperty(METAMODEL.revocationTime);
        if (revocationTimeStmt != null) {
          Literal revocationTimeLit = revocationTimeStmt.getLiteral();
          Date revocationTime;
          revocationTime = ((XSDDateTime) revocationTimeLit
              .getValue()).asCalendar().getTime();
          /*
           * try { revocationTime = new MillisDateFormat()
           * .parse(revocationTimeLit.getLexicalForm()); } catch
           * (ParseException e) { throw new RuntimeException(e); }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Literal

    ResIterator assertions = metaModel.listSubjectsWithProperty(
        METAMODEL.asserter, sourceRes);
    Set<NamedNode> result = new HashSet<NamedNode>();
    while (assertions.hasNext()) {
      Resource assertion = assertions.nextResource();
      Literal assertionTimeLit = assertion.getProperty(
          METAMODEL.assertionTime).getLiteral();
      Resource assertedComponent = assertion.getProperty(
          METAMODEL.assertedComponent).getResource();
      if (!assertedComponent.hasProperty(RDF.type, type)) {
        continue;
      }

      Date assertionTime;
      assertionTime = ((XSDDateTime) assertionTimeLit.getValue())
          .asCalendar().getTime();
      if (moment.equals(assertionTime)) {
        result.add(new NamedNodeImpl(assertedComponent.getURI()));
      }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Literal

        continue;
      }
      Statement revocationTimeStmt = assertion
          .getProperty(METAMODEL.revocationTime);
      if (revocationTimeStmt != null) {
        Literal revocationTimeLit = revocationTimeStmt.getLiteral();
        Date revocationTime = ((XSDDateTime) revocationTimeLit
            .getValue()).asCalendar().getTime();
        if (moment.equals(revocationTime)) {
          result.add(new NamedNodeImpl(assertedComponent.getURI()));
        }
      }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Literal

  /**
   * @param i
   * @return
   */
  private Iterator<ComponentDirectory> getComponentsByHash(int hashCode) {
    Literal hashLit = indexModel.createTypedLiteral(hashCode);
    final ResIterator resIterator = indexModel.listSubjectsWithProperty(
        METAMODEL.hashCode, hashLit);
    return new Iterator<ComponentDirectory>() {

      public boolean hasNext() {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Literal

        while (subjectIter.hasNext()) {
          Resource infoDiscoResource = subjectIter.nextResource();
          RDFNode infoBitNode = infoDiscoResource.getProperty(
              DISCOBITS.infoBit).getObject();
          if (infoBitNode instanceof Literal) {
            final Literal literaInfoBit = (Literal) infoBitNode;
            infoDiscoBitURIs.put(infoDiscoResource.getURI(),
                new InfoBit() {

                  public MessageBody getContent() {
                    return new MessageBody2Read() {

                      public ReadableByteChannel read()
                          throws IOException {
                        // TODO Auto-generated method
                        // stub
                        return Channels
                            .newChannel(new ByteArrayInputStream(
                                literaInfoBit
                                    .getString()
                                    .getBytes(
                                        "utf-8")));
                      }

                    };
                  }

                  public String getMimeTypeString() {
                    return "application/xhtml+xml";
                  }

                });
          } else {
            final Resource literaInfoBit = (Resource) infoBitNode;
            infoDiscoBitURIs.put(infoDiscoResource.getURI(),
                new InfoBit() {

                  public MessageBody getContent() {
                    return new MessageBody2Read() {

                      public ReadableByteChannel read()
                          throws IOException {
                        // TODO Auto-generated method
                        // stub
                        return Channels
                            .newChannel(new ByteArrayInputStream(
                                (byte[]) literaInfoBit.getRequiredProperty(DISCOBITS.bytes).getLiteral().getValue()
                                    ));
                      }

                    };
                  }

                  public String getMimeTypeString() {
                    return literaInfoBit.getRequiredProperty(DISCOBITS.mediaType).getString();
                  }

                });
          }
        }
View Full Code Here

Examples of com.pogofish.jadt.ast.Literal

        testLiteral(_CharLiteral("'c'"), "'c'");
    }

    private void testLiteral(Literal expected, String input) throws Exception {
        final ParserImpl p = parserImpl(input);
        final Literal lit = p.literal();
        assertEquals(Util.<SyntaxError>list().toString(), p.errors().toString());
        assertEquals(expected, lit);
       
    }
View Full Code Here

Examples of io.crate.planner.symbol.Literal

        Symbol left = function.arguments().get(0);
        if (!left.symbolType().isValueSymbol()) {
            return function;
        }
        Object inValue = ((Literal) left).value();
        Literal inList = (Literal) function.arguments().get(1);
        assert inList.valueType().id() == SetType.ID;
        Set values = (Set)inList.value();

        if (!values.contains(inValue)) {
            return Literal.newLiteral(false);
        }
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.