diff --git a/README.md b/README.md index b08a88e..fd924fc 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ $ mvn build $ mvn "-Dexec.args=-Dnde.config=`pwd`/conf/termennetwerk.xml -classpath %classpath nl.knaw.huc.di.nde.Main" -Dexec.executable=java org.codehaus.mojo:exec-maven-plugin:1.5.0:exec ``` -or via docker +or via docker: ```sh $ docker build -t nde-termennetwerk . @@ -23,14 +23,22 @@ $ docker run --rm -it -p 8080:8080 nde-termennetwerk ## Queries -The GraphIQL endpoint is hardwired to the NDE Termennetwerk GraphQL endpoint and supports autocomplete. +The GraphiQL endpoint is hardwired to the NDE Termennetwerk GraphQL endpoint and supports autocomplete. -Example query: +Example queries: ```graphql -query { terms(match:"Abkhazian",dataset:"clavas") {uri, altLabel} } +query { terms(match:"*Dutch*",dataset:"clavas") {uri, prefLabel} } ``` +```graphql +query { + terms(match:"*fietsen*" dataset:"gtaa") {uri prefLabel altLabel} +} +``` + +or via curl: + ```sh $ curl -XPOST -H 'Content-Type:application/graphql' -d 'query { terms(match:"Abkhazian",dataset:"clavas") {uri, altLabel} }' http://localhost:8080/nde/graphql ``` diff --git a/src/main/java/nl/knaw/huc/di/nde/recipe/OpenSKOS.java b/src/main/java/nl/knaw/huc/di/nde/recipe/OpenSKOS.java index f9a347d..0c8774f 100644 --- a/src/main/java/nl/knaw/huc/di/nde/recipe/OpenSKOS.java +++ b/src/main/java/nl/knaw/huc/di/nde/recipe/OpenSKOS.java @@ -56,6 +56,14 @@ public List fetchMatchingTerms(XdmItem config, String match) { for (Iterator lblIter = Saxon.xpathIterator(item, "skos:altLabel",null, OpenSKOS.NAMESPACES); lblIter.hasNext();) { term.altLabel.add(lblIter.next().getStringValue()); } + term.definition = new ArrayList<>(); + for (Iterator lblIter = Saxon.xpathIterator(item, "skos:definition",null, OpenSKOS.NAMESPACES); lblIter.hasNext();) { + term.definition.add(lblIter.next().getStringValue()); + } + term.scopeNote = new ArrayList<>(); + for (Iterator lblIter = Saxon.xpathIterator(item, "skos:scopeNote",null, OpenSKOS.NAMESPACES); lblIter.hasNext();) { + term.scopeNote.add(lblIter.next().getStringValue()); + } terms.add(term); } } catch (SaxonApiException | MalformedURLException | URISyntaxException ex) {