Concept:Seminar/Java

From BITPlan Wiki
Revision as of 18:03, 8 November 2017 by Wf (talk | contribs) (created by WikiTask 2017-11-08T17:03:15Z)
Jump to navigation Jump to search

java code

@// This is a rythm template
@// the args are the standard wikiTask arguments
@import org.sidif.triple.TripleQuery
@import org.sidif.triple.Triple
@import com.alibaba.fastjson.JSON
@args() {
  String title 
  String logo
  org.sidif.wiki.WikiTask wikiTask
  org.sidif.triple.TripleStore tripleStore
}


@def static {

  /**
   * Base class
   */
  static abstract class TopicBase {
    // each Topic has a pageid - for non subobject thats the pagename
    public String pageid;

    /**
     * get a WikiSon version of the given name value
     * 
     * @param name
     * @param value
     * @return - the string representation
     */
    public String toWikiSon(String name, String value) {
      String result = "<!-- " + name + " is null-->\n";
      if (value != null)
        result = "|" + name + "=" + value + "\n";
      return result;
    }

    /**
     * get the SiDIF representation of the given property
     * 
     * @param name - the name of the property
     * @param value - the value of the property
     * @param type - the type of the property
     * @return - the SiDIF Sting representation of the property
     */
    public static String propertySiDIF(String name, String value, String type) {
      // default is a comment line which can be filled by uncommenting
      String result = String.format("# is is %s of it\n",name);;
      // if the value is not empty
      if ((value != null) && (!("".equals(value.trim())))) {
        // do we need to quote the result?
        String quote = "";
        // this depends on the Type
        if ("Text".equals(type)) {
          quote = "\"";
        }
        // create a SIDIF Property line like
        // "John" is lastname of it
        // convert double quotes to single quotes - FIXME - should we escape instead?
        value=value.replace("\"","'");
        result = String.format("%s%s%s is %s of it\n",quote,value,quote,name);
      }
      // return the SiDIF property line
      return result;
    }

    /**
     * get me as a String
     * 
     * @param name
     * @param value
     * @return
     */
    public static String propertySiDIF(String name, String value) {
      String result = propertySiDIF(name, value, "Text");
      return result;
    }

    /**
     * check if the given boolean String value is true
     * 
     * @param value
     * @return true if the value is not null and has true/TRUE as it's string
     *         content
     */
    public boolean isTrue(String value) {
      boolean result = false;
      if (value != null && value.toLowerCase().equals("true")) {
        result = true;
      }
      return result;
    }

    /**
     * initialize
     */
    public void init(TripleQuery query) {
    }
  } // TopicBase
 /**
  * Seminar
  * Ein Seminar ist die Durchfuehrung einer Ausbildungsveranstaltung an einem bestimmten Ort in einem bestimmten Zeitraum zu einem bestimmten Thema
  */
  public static class Seminar extends TopicBase {
  
    public String kind;
    public String lang;
    public String thema;
    public String year;
    public String month;
    public String inHouse;
    public String city;
    public String from;
    public String to;
    public String title;
    public String contact;
    public String customer;
    public String documentation;
    public String trainer;
    public String location;

    public String getKind() { return kind; }
    public void setKind(String pKind) { kind=pKind; }
    public String getLang() { return lang; }
    public void setLang(String pLang) { lang=pLang; }
    public String getThema() { return thema; }
    public void setThema(String pThema) { thema=pThema; }
    public String getYear() { return year; }
    public void setYear(String pYear) { year=pYear; }
    public String getMonth() { return month; }
    public void setMonth(String pMonth) { month=pMonth; }
    public String getInHouse() { return inHouse; }
    public void setInHouse(String pInHouse) { inHouse=pInHouse; }
    public String getCity() { return city; }
    public void setCity(String pCity) { city=pCity; }
    public String getFrom() { return from; }
    public void setFrom(String pFrom) { from=pFrom; }
    public String getTo() { return to; }
    public void setTo(String pTo) { to=pTo; }
    public String getTitle() { return title; }
    public void setTitle(String pTitle) { title=pTitle; }
    public String getContact() { return contact; }
    public void setContact(String pContact) { contact=pContact; }
    public String getCustomer() { return customer; }
    public void setCustomer(String pCustomer) { customer=pCustomer; }
    public String getDocumentation() { return documentation; }
    public void setDocumentation(String pDocumentation) { documentation=pDocumentation; }
    public String getTrainer() { return trainer; }
    public void setTrainer(String pTrainer) { trainer=pTrainer; }
    public String getLocation() { return location; }
    public void setLocation(String pLocation) { location=pLocation; }
    /**
     * convert this Seminar to a JSON string
     */
    public String toJson() { return JSON.toJSONString(this); }

    /**
     * convert this Seminar to a WikiSon string
     * @return the WikiSon representation of this Seminar
     */
    public String toWikiSon() {
      String wikison= "{{Seminar\n";
      wikison+=toWikiSon("kind",kind);
      wikison+=toWikiSon("lang",lang);
      wikison+=toWikiSon("thema",thema);
      wikison+=toWikiSon("year",year);
      wikison+=toWikiSon("month",month);
      wikison+=toWikiSon("inHouse",inHouse);
      wikison+=toWikiSon("city",city);
      wikison+=toWikiSon("from",from);
      wikison+=toWikiSon("to",to);
      wikison+=toWikiSon("title",title);
      wikison+=toWikiSon("contact",contact);
      wikison+=toWikiSon("customer",customer);
      wikison+=toWikiSon("documentation",documentation);
      wikison+=toWikiSon("trainer",trainer);
      wikison+=toWikiSon("location",location);
      wikison+="}}\n";
      return wikison;
    }

    /**
     * convert this Seminar to a SiDIF string
     * @return the SiDIF representation of this Seminar
     */
    public String toSiDIF() {
      String siDIF = String.format("%s isA Seminar\n",this.pageid);
      siDIF+=propertySiDIF("kind",kind,"Page");
      siDIF+=propertySiDIF("lang",lang,"Text");
      siDIF+=propertySiDIF("thema",thema,"Text");
      siDIF+=propertySiDIF("year",year,"Text");
      siDIF+=propertySiDIF("month",month,"Text");
      siDIF+=propertySiDIF("inHouse",inHouse,"Boolean");
      siDIF+=propertySiDIF("city",city,"Page");
      siDIF+=propertySiDIF("from",from,"Date");
      siDIF+=propertySiDIF("to",to,"Date");
      siDIF+=propertySiDIF("title",title,"Text");
      siDIF+=propertySiDIF("contact",contact,"Text");
      siDIF+=propertySiDIF("customer",customer,"Text");
      siDIF+=propertySiDIF("documentation",documentation,"Text");
      siDIF+=propertySiDIF("trainer",trainer,"Page");
      siDIF+=propertySiDIF("location",location,"Page");
      return siDIF;
    }
 
    /**  
     * get the pageid for this topic
     */
    public String getPageid() { return pageid; };

    /**
     * default constructor for Seminar
     */
    public Seminar() {}

    /**
     * construct a Seminar from the given Triple
     * @param query - the TripleQuery to get the triples from
     * @param pSeminarTriple - the triple to construct me from
     */
    public Seminar(TripleQuery query,Triple pSeminarTriple) {
      this(query,pSeminarTriple.getSubject().toString());
    } // constructor

    /**
     * construct a Seminar from the given pageId
     * @param query - the TripleQuery to get the triples from
     * @param pageid - pageid
     */
    public Seminar(TripleQuery query,String pageid) {
      this.pageid=pageid;
      Triple kindTriple=query.selectSingle(pageid,"kind",null);
      if (kindTriple==null)
        kindTriple=query.selectSingle(pageid,"Property:Seminar_kind",null);
      if (kindTriple!=null) 
        kind=kindTriple.getObject().toString();
      Triple langTriple=query.selectSingle(pageid,"lang",null);
      if (langTriple==null)
        langTriple=query.selectSingle(pageid,"Property:Seminar_lang",null);
      if (langTriple!=null) 
        lang=langTriple.getObject().toString();
      Triple themaTriple=query.selectSingle(pageid,"thema",null);
      if (themaTriple==null)
        themaTriple=query.selectSingle(pageid,"Property:Seminar_thema",null);
      if (themaTriple!=null) 
        thema=themaTriple.getObject().toString();
      Triple yearTriple=query.selectSingle(pageid,"year",null);
      if (yearTriple==null)
        yearTriple=query.selectSingle(pageid,"Property:Seminar_year",null);
      if (yearTriple!=null) 
        year=yearTriple.getObject().toString();
      Triple monthTriple=query.selectSingle(pageid,"month",null);
      if (monthTriple==null)
        monthTriple=query.selectSingle(pageid,"Property:Seminar_month",null);
      if (monthTriple!=null) 
        month=monthTriple.getObject().toString();
      Triple inHouseTriple=query.selectSingle(pageid,"inHouse",null);
      if (inHouseTriple==null)
        inHouseTriple=query.selectSingle(pageid,"Property:Seminar_inHouse",null);
      if (inHouseTriple!=null) 
        inHouse=inHouseTriple.getObject().toString();
      Triple cityTriple=query.selectSingle(pageid,"city",null);
      if (cityTriple==null)
        cityTriple=query.selectSingle(pageid,"Property:Seminar_city",null);
      if (cityTriple!=null) 
        city=cityTriple.getObject().toString();
      Triple fromTriple=query.selectSingle(pageid,"from",null);
      if (fromTriple==null)
        fromTriple=query.selectSingle(pageid,"Property:Seminar_from",null);
      if (fromTriple!=null) 
        from=fromTriple.getObject().toString();
      Triple toTriple=query.selectSingle(pageid,"to",null);
      if (toTriple==null)
        toTriple=query.selectSingle(pageid,"Property:Seminar_to",null);
      if (toTriple!=null) 
        to=toTriple.getObject().toString();
      Triple titleTriple=query.selectSingle(pageid,"title",null);
      if (titleTriple==null)
        titleTriple=query.selectSingle(pageid,"Property:Seminar_title",null);
      if (titleTriple!=null) 
        title=titleTriple.getObject().toString();
      Triple contactTriple=query.selectSingle(pageid,"contact",null);
      if (contactTriple==null)
        contactTriple=query.selectSingle(pageid,"Property:Seminar_contact",null);
      if (contactTriple!=null) 
        contact=contactTriple.getObject().toString();
      Triple customerTriple=query.selectSingle(pageid,"customer",null);
      if (customerTriple==null)
        customerTriple=query.selectSingle(pageid,"Property:Seminar_customer",null);
      if (customerTriple!=null) 
        customer=customerTriple.getObject().toString();
      Triple documentationTriple=query.selectSingle(pageid,"documentation",null);
      if (documentationTriple==null)
        documentationTriple=query.selectSingle(pageid,"Property:Seminar_documentation",null);
      if (documentationTriple!=null) 
        documentation=documentationTriple.getObject().toString();
      Triple trainerTriple=query.selectSingle(pageid,"trainer",null);
      if (trainerTriple==null)
        trainerTriple=query.selectSingle(pageid,"Property:Seminar_trainer",null);
      if (trainerTriple!=null) 
        trainer=trainerTriple.getObject().toString();
      Triple locationTriple=query.selectSingle(pageid,"location",null);
      if (locationTriple==null)
        locationTriple=query.selectSingle(pageid,"Property:Seminar_location",null);
      if (locationTriple!=null) 
        location=locationTriple.getObject().toString();
      init(query);
    } // constructor for Seminar
    
    // >>>{user defined topic code}{Seminar}{Seminar}
    // <<<{user defined topic code}{Seminar}{Seminar}
  } // class Seminar
  /**
   * Manager for Seminar
   */
  public static class SeminarManager extends TopicBase {
 
    public String topicName="Seminar";
    public transient List<Seminar> mSeminars=new ArrayList<Seminar>();
    public transient Map<String,Seminar> mSeminarMap=new LinkedHashMap<String,Seminar>();

    /**
     * get my Seminars
     */
    public List<Seminar> getSeminars() {
      List<Seminar> result=this.mSeminars;
      return result;
    }

    /**
     *  add a new Seminar 
     */
    public Seminar add(Seminar pSeminar) {
      mSeminars.add(pSeminar);
      mSeminarMap.put(pSeminar.getPageid(),pSeminar);
      return pSeminar;
    }

    /**
     *  add a new Seminar from the given triple
     */
    public Seminar add(TripleQuery query,Triple pSeminarTriple) {
      Seminar lSeminar=new Seminar(query,pSeminarTriple);
      add(lSeminar);
      return lSeminar;
    }

    // reinitialize my mSeminar map
    public void reinit() {
      mSeminarMap.clear();
      for (Seminar lSeminar:mSeminars) {
        mSeminarMap.put(lSeminar.getPageid(),lSeminar);
      }
    }

    // convert this manager to json format 
    public String toJson() { return JSON.toJSONString(this); }
    
    // get a new manager from the given json string
    public static SeminarManager fromJson(String json) {
      SeminarManager result=JSON.parseObject(json, SeminarManager.class);
      result.reinit();
      return result;
    }

    // default constructor for Seminar Manager
    public SeminarManager() {}

    // add Seminars from the given query
    public void addSeminars(TripleQuery pSeminarQuery,TripleQuery query) {
      if (pSeminarQuery!=null) {
        for (Triple lSeminarTriple:pSeminarQuery.getTriples()) {
          add(query,lSeminarTriple);
        }
      }
    }

    // construct me from the given triple Query query
    public SeminarManager(TripleQuery query) {
      // first query the SiDIF bases triplestore
      TripleQuery lSeminarQuery=query.query(null,"isA","Seminar");
      addSeminars(lSeminarQuery,query);
      // then the SMW triplestore
      lSeminarQuery=query.query(null,"Property:IsA","Seminar");
      addSeminars(lSeminarQuery,query);
      init(query);
    } // constructor for Seminar Manager
    
    // >>>{user defined topicmanager code}{Seminar}{Seminar}
    // <<<{user defined topicmanager code}{Seminar}{Seminar}
  } // class Seminar Manager
 /**
  * Traininglocation
  * A location for a training
  */
  public static class Traininglocation extends TopicBase {
  
    public String name;
    public String coordinate;
    public String url;

    public String getName() { return name; }
    public void setName(String pName) { name=pName; }
    public String getCoordinate() { return coordinate; }
    public void setCoordinate(String pCoordinate) { coordinate=pCoordinate; }
    public String getUrl() { return url; }
    public void setUrl(String pUrl) { url=pUrl; }
    /**
     * convert this Traininglocation to a JSON string
     */
    public String toJson() { return JSON.toJSONString(this); }

    /**
     * convert this Traininglocation to a WikiSon string
     * @return the WikiSon representation of this Traininglocation
     */
    public String toWikiSon() {
      String wikison= "{{Traininglocation\n";
      wikison+=toWikiSon("name",name);
      wikison+=toWikiSon("coordinate",coordinate);
      wikison+=toWikiSon("url",url);
      wikison+="}}\n";
      return wikison;
    }

    /**
     * convert this Traininglocation to a SiDIF string
     * @return the SiDIF representation of this Traininglocation
     */
    public String toSiDIF() {
      String siDIF = String.format("%s isA Traininglocation\n",this.pageid);
      siDIF+=propertySiDIF("name",name,"Text");
      siDIF+=propertySiDIF("coordinate",coordinate,"Geographic_coordinate");
      siDIF+=propertySiDIF("url",url,"URL");
      return siDIF;
    }
 
    /**  
     * get the pageid for this topic
     */
    public String getPageid() { return pageid; };

    /**
     * default constructor for Traininglocation
     */
    public Traininglocation() {}

    /**
     * construct a Traininglocation from the given Triple
     * @param query - the TripleQuery to get the triples from
     * @param pTraininglocationTriple - the triple to construct me from
     */
    public Traininglocation(TripleQuery query,Triple pTraininglocationTriple) {
      this(query,pTraininglocationTriple.getSubject().toString());
    } // constructor

    /**
     * construct a Traininglocation from the given pageId
     * @param query - the TripleQuery to get the triples from
     * @param pageid - pageid
     */
    public Traininglocation(TripleQuery query,String pageid) {
      this.pageid=pageid;
      Triple nameTriple=query.selectSingle(pageid,"name",null);
      if (nameTriple==null)
        nameTriple=query.selectSingle(pageid,"Property:Traininglocation_name",null);
      if (nameTriple!=null) 
        name=nameTriple.getObject().toString();
      Triple coordinateTriple=query.selectSingle(pageid,"coordinate",null);
      if (coordinateTriple==null)
        coordinateTriple=query.selectSingle(pageid,"Property:Traininglocation_coordinate",null);
      if (coordinateTriple!=null) 
        coordinate=coordinateTriple.getObject().toString();
      Triple urlTriple=query.selectSingle(pageid,"url",null);
      if (urlTriple==null)
        urlTriple=query.selectSingle(pageid,"Property:Traininglocation_url",null);
      if (urlTriple!=null) 
        url=urlTriple.getObject().toString();
      init(query);
    } // constructor for Traininglocation
    
    // >>>{user defined topic code}{Traininglocation}{Traininglocation}
    // <<<{user defined topic code}{Traininglocation}{Traininglocation}
  } // class Traininglocation
  /**
   * Manager for Traininglocation
   */
  public static class TraininglocationManager extends TopicBase {
 
    public String topicName="Traininglocation";
    public transient List<Traininglocation> mTraininglocations=new ArrayList<Traininglocation>();
    public transient Map<String,Traininglocation> mTraininglocationMap=new LinkedHashMap<String,Traininglocation>();

    /**
     * get my Traininglocations
     */
    public List<Traininglocation> getTraininglocations() {
      List<Traininglocation> result=this.mTraininglocations;
      return result;
    }

    /**
     *  add a new Traininglocation 
     */
    public Traininglocation add(Traininglocation pTraininglocation) {
      mTraininglocations.add(pTraininglocation);
      mTraininglocationMap.put(pTraininglocation.getPageid(),pTraininglocation);
      return pTraininglocation;
    }

    /**
     *  add a new Traininglocation from the given triple
     */
    public Traininglocation add(TripleQuery query,Triple pTraininglocationTriple) {
      Traininglocation lTraininglocation=new Traininglocation(query,pTraininglocationTriple);
      add(lTraininglocation);
      return lTraininglocation;
    }

    // reinitialize my mTraininglocation map
    public void reinit() {
      mTraininglocationMap.clear();
      for (Traininglocation lTraininglocation:mTraininglocations) {
        mTraininglocationMap.put(lTraininglocation.getPageid(),lTraininglocation);
      }
    }

    // convert this manager to json format 
    public String toJson() { return JSON.toJSONString(this); }
    
    // get a new manager from the given json string
    public static TraininglocationManager fromJson(String json) {
      TraininglocationManager result=JSON.parseObject(json, TraininglocationManager.class);
      result.reinit();
      return result;
    }

    // default constructor for Traininglocation Manager
    public TraininglocationManager() {}

    // add Traininglocations from the given query
    public void addTraininglocations(TripleQuery pTraininglocationQuery,TripleQuery query) {
      if (pTraininglocationQuery!=null) {
        for (Triple lTraininglocationTriple:pTraininglocationQuery.getTriples()) {
          add(query,lTraininglocationTriple);
        }
      }
    }

    // construct me from the given triple Query query
    public TraininglocationManager(TripleQuery query) {
      // first query the SiDIF bases triplestore
      TripleQuery lTraininglocationQuery=query.query(null,"isA","Traininglocation");
      addTraininglocations(lTraininglocationQuery,query);
      // then the SMW triplestore
      lTraininglocationQuery=query.query(null,"Property:IsA","Traininglocation");
      addTraininglocations(lTraininglocationQuery,query);
      init(query);
    } // constructor for Traininglocation Manager
    
    // >>>{user defined topicmanager code}{Traininglocation}{Traininglocation}
    // <<<{user defined topicmanager code}{Traininglocation}{Traininglocation}
  } // class Traininglocation Manager
 /**
  * Trainer
  * A trainer is a teacher
  */
  public static class Trainer extends TopicBase {
  
    public String name;
    public String picture;
    public String description;
    public String description_de;

    public String getName() { return name; }
    public void setName(String pName) { name=pName; }
    public String getPicture() { return picture; }
    public void setPicture(String pPicture) { picture=pPicture; }
    public String getDescription() { return description; }
    public void setDescription(String pDescription) { description=pDescription; }
    public String getDescription_de() { return description_de; }
    public void setDescription_de(String pDescription_de) { description_de=pDescription_de; }
    /**
     * convert this Trainer to a JSON string
     */
    public String toJson() { return JSON.toJSONString(this); }

    /**
     * convert this Trainer to a WikiSon string
     * @return the WikiSon representation of this Trainer
     */
    public String toWikiSon() {
      String wikison= "{{Trainer\n";
      wikison+=toWikiSon("name",name);
      wikison+=toWikiSon("picture",picture);
      wikison+=toWikiSon("description",description);
      wikison+=toWikiSon("description_de",description_de);
      wikison+="}}\n";
      return wikison;
    }

    /**
     * convert this Trainer to a SiDIF string
     * @return the SiDIF representation of this Trainer
     */
    public String toSiDIF() {
      String siDIF = String.format("%s isA Trainer\n",this.pageid);
      siDIF+=propertySiDIF("name",name,"Text");
      siDIF+=propertySiDIF("picture",picture,"Page");
      siDIF+=propertySiDIF("description",description,"text");
      siDIF+=propertySiDIF("description_de",description_de,"text");
      return siDIF;
    }
 
    /**  
     * get the pageid for this topic
     */
    public String getPageid() { return pageid; };

    /**
     * default constructor for Trainer
     */
    public Trainer() {}

    /**
     * construct a Trainer from the given Triple
     * @param query - the TripleQuery to get the triples from
     * @param pTrainerTriple - the triple to construct me from
     */
    public Trainer(TripleQuery query,Triple pTrainerTriple) {
      this(query,pTrainerTriple.getSubject().toString());
    } // constructor

    /**
     * construct a Trainer from the given pageId
     * @param query - the TripleQuery to get the triples from
     * @param pageid - pageid
     */
    public Trainer(TripleQuery query,String pageid) {
      this.pageid=pageid;
      Triple nameTriple=query.selectSingle(pageid,"name",null);
      if (nameTriple==null)
        nameTriple=query.selectSingle(pageid,"Property:Trainer_name",null);
      if (nameTriple!=null) 
        name=nameTriple.getObject().toString();
      Triple pictureTriple=query.selectSingle(pageid,"picture",null);
      if (pictureTriple==null)
        pictureTriple=query.selectSingle(pageid,"Property:Trainer_picture",null);
      if (pictureTriple!=null) 
        picture=pictureTriple.getObject().toString();
      Triple descriptionTriple=query.selectSingle(pageid,"description",null);
      if (descriptionTriple==null)
        descriptionTriple=query.selectSingle(pageid,"Property:Trainer_description",null);
      if (descriptionTriple!=null) 
        description=descriptionTriple.getObject().toString();
      Triple description_deTriple=query.selectSingle(pageid,"description_de",null);
      if (description_deTriple==null)
        description_deTriple=query.selectSingle(pageid,"Property:Trainer_description_de",null);
      if (description_deTriple!=null) 
        description_de=description_deTriple.getObject().toString();
      init(query);
    } // constructor for Trainer
    
    // >>>{user defined topic code}{Trainer}{Trainer}
    // <<<{user defined topic code}{Trainer}{Trainer}
  } // class Trainer
  /**
   * Manager for Trainer
   */
  public static class TrainerManager extends TopicBase {
 
    public String topicName="Trainer";
    public transient List<Trainer> mTrainers=new ArrayList<Trainer>();
    public transient Map<String,Trainer> mTrainerMap=new LinkedHashMap<String,Trainer>();

    /**
     * get my Trainers
     */
    public List<Trainer> getTrainers() {
      List<Trainer> result=this.mTrainers;
      return result;
    }

    /**
     *  add a new Trainer 
     */
    public Trainer add(Trainer pTrainer) {
      mTrainers.add(pTrainer);
      mTrainerMap.put(pTrainer.getPageid(),pTrainer);
      return pTrainer;
    }

    /**
     *  add a new Trainer from the given triple
     */
    public Trainer add(TripleQuery query,Triple pTrainerTriple) {
      Trainer lTrainer=new Trainer(query,pTrainerTriple);
      add(lTrainer);
      return lTrainer;
    }

    // reinitialize my mTrainer map
    public void reinit() {
      mTrainerMap.clear();
      for (Trainer lTrainer:mTrainers) {
        mTrainerMap.put(lTrainer.getPageid(),lTrainer);
      }
    }

    // convert this manager to json format 
    public String toJson() { return JSON.toJSONString(this); }
    
    // get a new manager from the given json string
    public static TrainerManager fromJson(String json) {
      TrainerManager result=JSON.parseObject(json, TrainerManager.class);
      result.reinit();
      return result;
    }

    // default constructor for Trainer Manager
    public TrainerManager() {}

    // add Trainers from the given query
    public void addTrainers(TripleQuery pTrainerQuery,TripleQuery query) {
      if (pTrainerQuery!=null) {
        for (Triple lTrainerTriple:pTrainerQuery.getTriples()) {
          add(query,lTrainerTriple);
        }
      }
    }

    // construct me from the given triple Query query
    public TrainerManager(TripleQuery query) {
      // first query the SiDIF bases triplestore
      TripleQuery lTrainerQuery=query.query(null,"isA","Trainer");
      addTrainers(lTrainerQuery,query);
      // then the SMW triplestore
      lTrainerQuery=query.query(null,"Property:IsA","Trainer");
      addTrainers(lTrainerQuery,query);
      init(query);
    } // constructor for Trainer Manager
    
    // >>>{user defined topicmanager code}{Trainer}{Trainer}
    // <<<{user defined topicmanager code}{Trainer}{Trainer}
  } // class Trainer Manager

}
Showing below 0 pages.

Retrieved from "https://wiki.bitplan.com/index.php?title=Concept:Seminar/Java&oldid=3889#smw-result"