Package lupos.datastructures.items.literal

Examples of lupos.datastructures.items.literal.Literal


    // fill the data model of the chart
    while (it.hasNext()) {
      Bindings bind = it.next();
      Number tmp;
      // find the variable ...
      Literal lit = bind.get(valueVar);
      // ... and extract the value
      if (lit != null) {
        tmp = literal2Number(lit);
        if (tmp != null) {
          y[countBind] = tmp.intValue();
View Full Code Here


  public DBAnswer(Bindings b) throws Exception {
    String[] variables = { "thumbnail", "wikiarticle", "subject", "name",
        "birthDate", "deathDate", "birthPlace", "label""comment" };
    int i = 0;
    Literal k = b.get(new Variable(variables[i]));
    if (k != Literals.createTyped("", Literals.XSD.String))
      this.thumbnail = k;
    i++;
    k = b.get(new Variable(variables[i]));
    if (k != Literals.createTyped("", Literals.XSD.String))
View Full Code Here

  }
 
  public ArrayList<Triple> generateTriples() throws Exception {
     
    // generate literals
    Literal messageTitleObject = Literals.createTyped("",Literals.XSD.String);
    Literal messageDescriptionObject = Literals.createTyped("",Literals.XSD.String);
    Literal messageLinkObject = Literals.createTyped("",Literals.XSD.String);
    Literal messageAuthorObject = Literals.createTyped("",Literals.XSD.String);
    Literal messageGuidObject = Literals.createTyped("",Literals.XSD.String);
   
    messageTitleObject = Literals.createTyped(this.getTitle()+"", Literals.XSD.String);
    messageDescriptionObject = Literals.createTyped(this.getDescription()+"", Literals.XSD.String);
    messageLinkObject = Literals.createTyped(new URL(this.getLink())+"", Literals.XSD.ANYURI);
    messageAuthorObject = Literals.createTyped(this.getAuthor()+"", Literals.XSD.String);
View Full Code Here

  private List<List<Triple>> trainToEvents(TrainInfo train) {
    List<List<Triple>> result = new ArrayList<List<Triple>>();

    try {
      // the train subject
      Literal subj = LiteralFactory.createAnonymousLiteral("_:t"+ train.id);

      // the train's name
      Literal nameObj = LiteralFactory.createTypedLiteral("\"" + train.name + "\"", Literals.XSD.String);

      // for each station, compose a new event
      for (StationDelayInfo sdi : train.delayPerStation) {
        List<Triple> event = stationDelayInfoToTriples(subj, sdi);
View Full Code Here

   */
  private List<Triple> stationDelayInfoToTriples(Literal trainSubj,
      StationDelayInfo sdi) {
    List<Triple> result = new ArrayList<Triple>();
    try {
      Literal obj;

      // station name
      obj = LiteralFactory.createTypedLiteral("\"" + sdi.station.name + "\"", Literals.XSD.String);
      result.add(new Triple(trainSubj, STATION_NAME, obj));

View Full Code Here

        // creates an array list
        List<Triple> triples = new ArrayList<Triple>();

        // create an event instance for found weather
        // create triples
        final Literal currentWeatherObject = Literals.createTyped(currentWeatherValue, Literals.XSD.String);
        final Literal temperatureObject = Literals.createTyped(temperatureValue, Literals.XSD.DECIMAL);
        final Literal feelslikeObject = Literals.createTyped(feelslikeValue, Literals.XSD.DECIMAL);
        final Literal humidityObject = Literals.createTyped(humidityValue, Literals.XSD.String);
        final Literal windObject = Literals.createTyped(windValue, Literals.XSD.String);
        final Literal observationTimeObject = Literals.createTyped(observationTimeValue, Literals.XSD.String);
        final Literal currentTimeObject = Literals.createTyped(currentTimeValue, Literals.XSD.String);
        final Literal ztShortObject = Literals.createTyped(ztShortValue, Literals.XSD.String);
        final Literal ztLongObject = Literals.createTyped(ztLongValue, Literals.XSD.String);
        final Literal windDegreeObject = Literals.createTyped(windDegreeValue, Literals.XSD.DECIMAL);
        final Literal windKPHObject = Literals.createTyped(windKPHValue, Literals.XSD.DECIMAL);
        final Literal windGustKPHObject = Literals.createTyped(windGustKPHValue, Literals.XSD.DECIMAL);
        final Literal pressureMBObject = Literals.createTyped(pressureMBValue, Literals.XSD.DECIMAL);
        final Literal pressureINObject = Literals.createTyped(pressureINValue, Literals.XSD.DECIMAL);
        final Literal dewpointObject = Literals.createTyped(dewpointValue, Literals.XSD.DECIMAL);
        final Literal heatIndexObject = Literals.createTyped(heatIndexValue, Literals.XSD.String);
        final Literal windchillObject = Literals.createTyped(windchillValue, Literals.XSD.DECIMAL);
        final Literal visibilityMIObject = Literals.createTyped(visibilityMIValue, Literals.XSD.String);
        final Literal visibilityKMObject = Literals.createTyped(visibilityKMValue, Literals.XSD.String);
        final Literal solarRadiationObject = Literals.createTyped(solarRadiationValue, Literals.XSD.DECIMAL);
        final Literal uvObject = Literals.createTyped(uvValue, Literals.XSD.DECIMAL);
        final Literal precip1hrObject = Literals.createTyped(precip1hrValue, Literals.XSD.DECIMAL);
        final Literal precipTodayObject = Literals.createTyped(precipTodayValue, Literals.XSD.DECIMAL);
        final Literal iconObject = Literals.createTyped(iconValue, Literals.XSD.String);
        final Literal iconUrlObject = Literals.createTyped(iconUrlValue, Literals.XSD.String);
        final Literal forecastUrlObject = Literals.createTyped(forecastUrlValue, Literals.XSD.String);
        final Literal historyUrlObject = Literals.createTyped(historyUrlValue, Literals.XSD.String);
        final Literal obUrlObject = Literals.createTyped(obUrlValue, Literals.XSD.String);

        final Literal cityNameObject = Literals.createTyped(cityNameValue, Literals.XSD.String);
        final Literal countryNameObject = Literals.createTyped(countryNameValue, Literals.XSD.String);
        final Literal countryCodeObject = Literals.createTyped(countryCodeValue, Literals.XSD.String);
        final Literal latiObject = Literals.createTyped(latiValue, Literals.XSD.DECIMAL);
        final Literal longiObject = Literals.createTyped(longiValue, Literals.XSD.DECIMAL);
        final Literal elevObject = Literals.createTyped(elevValue, Literals.XSD.String);

        final Literal currentCityObject = Literals.createTyped(currentCityValue, Literals.XSD.String);
        final Literal country2CodeObject = Literals.createTyped(country2CodeValue, Literals.XSD.String);
        final Literal lati2Object = Literals.createTyped(lati2Value, Literals.XSD.DECIMAL);
        final Literal longi2Object = Literals.createTyped(longi2Value, Literals.XSD.DECIMAL);
        final Literal elev2Object = Literals.createTyped(elev2Value, Literals.XSD.DECIMAL);
       
       
        // Adds triples (subject, predicate, object) to the array list
        triples.add(new Triple(Literals.AnonymousLiteral.ANONYMOUS, Literals.RDF.TYPE, Predicates.TYPE));
       
View Full Code Here

      this.previousCpuTimes = currentCpuTimes;

      // build triples
      Triple typeTriple = new Triple(Literals.AnonymousLiteral.ANONYMOUS, Literals.RDF.TYPE, SysMonProducer.TYPE);
     
      Literal uptimeObj = Literals.createTyped(uptime+"", Literals.XSD.LONG);
      Triple uptimeTriple = new Triple(Literals.AnonymousLiteral.ANONYMOUS, Predicates.UPTIME, uptimeObj);
     
      Literal usageObj = Literals.createTyped(usage+"", Literals.XSD.FLOAT);
      Triple usageTriple = new Triple(Literals.AnonymousLiteral.ANONYMOUS, Predicates.CPU_USAGE, usageObj);
     
      Triple cpuFrequencyInHzTriple = new Triple(Literals.AnonymousLiteral.ANONYMOUS, Predicates.CPU_FREQUENCY, Literals.createTyped(cpuFrequencyInHz+"", Literals.XSD.LONG));
     
      Triple currentPIDTriple = new Triple(Literals.AnonymousLiteral.ANONYMOUS, Predicates.PID, Literals.createTyped(currentPID+"", Literals.XSD.INT));
View Full Code Here

        String street = locationObject.getString("street");
        String postalcode = locationObject.getString("postalcode");
        String city = locationObject.getString("city");
       
        //Create an anonymous id
        Literal subject = LiteralFactory.createAnonymousLiteral("<"+id+">");

        //Create triples for each attribute
        triples.add(new Triple(subject, Literals.RDF.TYPE, EVENT_TYPE_OBJECT));
        triples.add(new Triple(subject, HEADLINER_PREDICATE, LiteralFactory.createStringLiteral("\""+Utils.escape(headliner)+"\"")));
        triples.add(new Triple(subject, ID_PREDICATE, LiteralFactory.createTypedLiteral("\""+id+"\"", Literals.XSD.LONG)));
View Full Code Here

        return triples;
      }
    }
   
    long timestamp = System.currentTimeMillis() / 1000;
    Literal obj = Literals.createTyped(timestamp+"", Literals.XSD.LONG);
    Triple timestampTriple = new Triple(triples.get(0).getSubject(), this.TIMESTAMP_LITERAL, obj);
   
    List<Triple> triples2 = new ArrayList<Triple>(triples);
    triples2.add(timestampTriple);
    return triples2;
View Full Code Here

    while (it.hasNext()) {
      Bindings bind = it.next();
      Number y1 = null;
      Number y2 = null;
      String column = null;
      Literal lit = bind.get(valueVar);
      // find the variable ...
      if (lit != null) {
        // ... and extract the value
        y1 = literal2Number(lit);
View Full Code Here

TOP

Related Classes of lupos.datastructures.items.literal.Literal

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.