Exemplo n.º 1
0
  private boolean addNewRDFTerm() {
    // TODO Auto-generated method stub
    // System.out.println("Finally I am going to add " + childTerm.getText());
    AIDRemoteQuery remote = AIDRemoteQuery.getDefaultRepository();

    /** The Subject to be added * */
    String theSubject = childUrl.getText();

    /** Predicates * */
    String type = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
    String broader = "http://www.w3.org/2004/02/skos/core#broader";
    String inScheme = "http://www.w3.org/2004/02/skos/core#inScheme";
    String prefLabel = "http://www.w3.org/2004/02/skos/core#prefLabel";

    /** Objects * */
    String concept_type = "http://www.w3.org/2004/02/skos/core#Concept";
    String parent_broader = node.getUrl();
    String scheme =
        "http://www.afsg.nl/www_foodontology_nl/data/documenten/Ontology/TNO_FI-Ontology_2007_jan.owl#scheme";
    String label = childTerm.getText();

    try {
      remote.addRdfStatement(theSubject, type, concept_type);
      remote.addRdfStatement(theSubject, broader, parent_broader);
      remote.addRdfStatement(theSubject, inScheme, scheme);
      remote.addRdfStatement(theSubject, prefLabel, label);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return false;
    }
    return true;
  }
 public AIDBrowseTreeTableModel() {
   this(new AIDBrowseTreeTableNode(AIDRemoteQuery.getDefaultThesaurusRepository(), "/", "/"));
 }