@Override protected Boolean doInBackground() throws Exception { treeTable.setCursor(new Cursor(Cursor.WAIT_CURSOR)); boolean result = addNewRDFTerm(); node.expandNode(); return result; }
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 AIDAddRDFStatement(AIDBrowseTreeTable treeTable, TreePath selectedPath) { this.selectedPath = selectedPath; this.node = (AIDBrowseTreeTableNode) selectedPath.getLastPathComponent(); this.treeTable = treeTable; // setIconImage(Gui.getIcon("icons/vle.png").getImage()); // God forbid maybe this should be grid bag layout also, i wanted to anchored this thing to the // left // So if its expanded it stays, anchored to the left. Now its centered. getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.PAGE_AXIS)); JXTitledPanel currentPanel = createCurrentPanel(node.getTerm(), node.getUrl(), "Broader Term", false); JXTitledPanel childPanel = createChildPanel(node.getTerm(), node.getUrl(), "New Term", true); getContentPane().add(currentPanel); getContentPane().add(childPanel); getContentPane().add(getButtons()); setSize(node.getUrl().length() * 8, 300); }