diff --git a/src/com/expertsystem/lab/lov/LOVConnector.java b/src/com/expertsystem/lab/lov/LOVConnector.java index d2fa8d8..2eb7c80 100644 --- a/src/com/expertsystem/lab/lov/LOVConnector.java +++ b/src/com/expertsystem/lab/lov/LOVConnector.java @@ -129,21 +129,64 @@ public List parseTerms(JSONObject json){ //Comment String comment = ""; if(!highlight.isNull("http://www.w3.org/2000/01/rdf-schema#comment")){ - comment = highlight.getJSONArray("http://www.w3.org/2000/01/rdf-schema#comment").get(0).toString(); + JSONArray array_comment = highlight.getJSONArray("http://www.w3.org/2000/01/rdf-schema#comment"); + for(int j=0; j"; + } + //comment = highlight.getJSONArray("http://www.w3.org/2000/01/rdf-schema#comment").get(0).toString(); //comment = comment.replaceAll("\"", " "); //comment = comment.replace('"', '\"'); //System.out.println(comment); + } + if(!highlight.isNull("http://www.w3.org/2000/01/rdf-schema#comment@en")){ + JSONArray array_comment = highlight.getJSONArray("http://www.w3.org/2000/01/rdf-schema#comment@en"); + for(int j=0; j"; + } + //comment = highlight.getJSONArray("http://www.w3.org/2000/01/rdf-schema#comment@en").get(0).toString(); + //comment = comment.replaceAll("\"", " "); + //comment = comment.replace('"', '\"'); + //System.out.println(comment); } //Label String label = ""; if(!highlight.isNull("http://www.w3.org/2000/01/rdf-schema#label")){ - label = highlight.getJSONArray("http://www.w3.org/2000/01/rdf-schema#label").get(0).toString(); + JSONArray array_label = highlight.getJSONArray("http://www.w3.org/2000/01/rdf-schema#label"); + for(int j=0; j"; + } + //label = highlight.getJSONArray("http://www.w3.org/2000/01/rdf-schema#label").get(0).toString(); //System.out.println(label); } - ResultsListItem item = new ResultsListItem(local_name, prefix, uri, ocurrences, datasets, comment, label, score); + if(!highlight.isNull("http://www.w3.org/2000/01/rdf-schema#label@en")){ + JSONArray array_label = highlight.getJSONArray("http://www.w3.org/2000/01/rdf-schema#label@en"); + for(int j=0; j"; + } + //label = highlight.getJSONArray("http://www.w3.org/2000/01/rdf-schema#label@en").get(0).toString(); + //System.out.println(label); + } + + //UsageNote + String usageNote = ""; + if(!highlight.isNull("http://purl.org/vocab/vann/usageNote")){ + JSONArray array_usageNote = highlight.getJSONArray("http://purl.org/vocab/vann/usageNote"); + for(int j=0; j"; + } + } + + if(!highlight.isNull("http://purl.org/vocab/vann/usageNote@en")){ + JSONArray array_usageNote = highlight.getJSONArray("http://purl.org/vocab/vann/usageNote@en"); + for(int j=0; j"; + } + } + + ResultsListItem item = new ResultsListItem(local_name, prefix, uri, ocurrences, datasets, comment, label, usageNote, score); results.add(item); } } diff --git a/src/com/expertsystem/lab/lov/ResultsListItem.java b/src/com/expertsystem/lab/lov/ResultsListItem.java index fad6d73..b64463f 100644 --- a/src/com/expertsystem/lab/lov/ResultsListItem.java +++ b/src/com/expertsystem/lab/lov/ResultsListItem.java @@ -11,6 +11,7 @@ public class ResultsListItem implements MListItem { private String num_datasets; private String comment; private String label; + private String usageNote; private double confidence; public ResultsListItem(String name){ @@ -21,11 +22,12 @@ public ResultsListItem(String name){ this.num_datasets = "0"; this.comment = ""; this.label = ""; + this.usageNote = ""; this.confidence = 0.0; } public ResultsListItem(String name, String prefix, String url_vocab, String num_ocurrences, String num_datasets, - String comment, String label, double confidence){ + String comment, String label, String usageNote, double confidence){ this.name = name; this.prefix = prefix; this.url_vocab = url_vocab; @@ -33,6 +35,7 @@ public ResultsListItem(String name, String prefix, String url_vocab, String num_ this.num_datasets = num_datasets; this.comment = comment; this.label = label; + this.usageNote = usageNote; this.confidence = confidence; } @@ -90,6 +93,14 @@ public String getLabel() { public void setLabel(String label) { this.label = label; + } + + public String getUsageNote() { + return usageNote; + } + + public void setUsageNote(String usageNote) { + this.usageNote = usageNote; } public double getConfidence() { diff --git a/src/com/expertsystem/lab/protege/plugin/lov/LOVResultsPanel.java b/src/com/expertsystem/lab/protege/plugin/lov/LOVResultsPanel.java index 67026af..7b923de 100644 --- a/src/com/expertsystem/lab/protege/plugin/lov/LOVResultsPanel.java +++ b/src/com/expertsystem/lab/protege/plugin/lov/LOVResultsPanel.java @@ -155,11 +155,15 @@ public Component getListCellRendererComponent(JList list, Object value, text += "" + item.getUrl_vocab() + "
"; if(!item.getComment().equals("")){ - text += " rdfs:comment " + item.getComment() + "
"; + text += " rdfs:comment " + item.getComment(); } if(!item.getLabel().equals("")){ - text += " rdfs:label " + item.getLabel() + "
"; + text += " rdfs:label " + item.getLabel(); + } + + if(!item.getUsageNote().equals("")){ + text += " http://purl.org/vocab/vann/usageNote " + item.getUsageNote(); } text += " localName " + item.getName();