{"id":13609624,"url":"https://github.com/jprante/elasticsearch-analysis-skos","last_synced_at":"2026-01-10T18:54:41.231Z","repository":{"id":4268715,"uuid":"5396365","full_name":"jprante/elasticsearch-analysis-skos","owner":"jprante","description":"SKOS analysis for Elasticsearch","archived":false,"fork":false,"pushed_at":"2016-06-15T21:09:49.000Z","size":1066,"stargazers_count":54,"open_issues_count":6,"forks_count":24,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-05-22T19:33:12.368Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jprante.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-13T08:06:23.000Z","updated_at":"2023-11-23T14:56:17.000Z","dependencies_parsed_at":"2022-08-26T09:20:51.808Z","dependency_job_id":null,"html_url":"https://github.com/jprante/elasticsearch-analysis-skos","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jprante%2Felasticsearch-analysis-skos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jprante%2Felasticsearch-analysis-skos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jprante%2Felasticsearch-analysis-skos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jprante%2Felasticsearch-analysis-skos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jprante","download_url":"https://codeload.github.com/jprante/elasticsearch-analysis-skos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248629853,"owners_count":21136327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:36.608Z","updated_at":"2025-04-12T20:32:09.326Z","avatar_url":"https://github.com/jprante.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"Elasticsearch SKOS analysis plugin\n==================================\n\nThis is the SKOS support for Lucene, originally written by Bernhard Haslhofer for Lucene and Solr,\nported to Elasticsearch.\n\nFor more information about the original version, please see https://github.com/behas/lucene-skos\n\nFor a presentation and discussion, see\nhttp://de.slideshare.net/bhaslhofer/using-skos-vocabularies-for-improving-web-search\n\nWhat is SKOS?\n-------------\nThe Simple Knowledge Organization System  (SKOS) is a model for expressing controlled structured\nvocabularies (classification schemes, thesauri, taxonomies, etc.).\nAs an application of the Resource Description Framework (RDF),\nSKOS allows these vocabularies to be published as dereferenceable resources on the Web,\nwhich makes them easy to retrieve and reuse in applications. SKOS plays a major role in the\nongoing Linked Data activities.\n\nSKOS analysis\n-------------\n\nSKOS for `Elasticsearch`_ is an analyzer plugin. It takes existing SKOS concepts schemes\nand performs term expansion for given documents and/or queries.\n\nFeatures\n--------\n\nThe module supports the following use cases:\n\n- Expansion of URI terms to SKOS labels: URI-references to SKOS concepts in given\n  documents are expanded by the labels behind those concepts.\n\n- Expansion of text terms to SKOS labels: Labels in given documents, which are\n  defined as preferred concept labels in a given SKOS vocabulary, are expanded by\n  additional labels defined in that vocabulary.\n\nInstallation\n------------\n\n(https://travis-ci.org/jprante/elasticsearch-analysis-skos.png)\n\n| Elasticsearch | SKOS Plugin | Release date |\n| ------------- | ----------- | -------------|\n| 2.3.3         | 2.3.3.0     | Jun 15, 2016 |\n| 2.3.0         | 2.3.0.0     | Apr  1, 2016 |\n| 2.2.1         | 2.2.1.1     | Apr  1, 2016 |\n| 2.1.1         | 2.1.1.1     | Jan 13, 2016 |\n| 1.4.2         | 1.4.2.0     | Feb  5, 2015 |\n\n2.x\n---\n\n    ./bin/plugin install http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-analysis-skos/2.3.3.0/elasticsearch-analysis-skos-2.3.3.0-plugin.zip\n\nDo not forget to restart the node after installing. You have to disable the security manager in order to get Jena to work:\n\n    ./bin/elasticsearch -Des.security.manager.enabled=false\n\n1.x\n---\n\n    ./bin/plugin -install analysis-skos -url  http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-analysis-skos/1.4.2.0/elasticsearch-analysis-skos-1.4.2.0.zip\n\nDo not forget to restart the node after installing.\n\nProject docs\n------------\n\nThe Maven project site is available at [Github](http://jprante.github.io/elasticsearch-analysis-skos)\n\nExample\n=======\n\nGiven the following example SKOS file *ukat_examples.n3* in *$ES\\_HOME*\n\n\t@prefix skos:   \u003chttp://www.w3.org/2004/02/skos/core#\u003e .\n\t@prefix rdf:    \u003chttp://www.w3.org/1999/02/22-rdf-syntax-ns#\u003e .\n\t@prefix rdfs:   \u003chttp://www.w3.org/2000/01/rdf-schema#\u003e .\n\t@prefix ukat:   \u003chttp://www.ukat.org.uk/thesaurus/concept/\u003e .\n\n\tukat:859 rdf:type skos:Concept ;\n\t        skos:prefLabel \"Weapons\" ;\n\t        skos:altLabel \"Armaments\" ;\n\t        skos:altLabel \"Arms\" ;\n\t        skos:broader ukat:5060 ;\n\t        skos:narrower ukat:18874 ;\n\t        skos:narrower ukat:7630 .\n\n\tukat:5060 rdf:type skos:Concept;\n\t        skos:prefLabel \"Military equipment\";\n\t        skos:altLabel \"Defense equipment and supplies\";\n\t        skos:altLabel \"Ordnance\".\n\n\tukat:18874 rdf:type skos:Concept;\n\t        skos:prefLabel \"Ammunition\".\n\n\tukat:7630 rdf:type skos:Concept;\n\t        skos:prefLabel \"Artillery\".\n\nyou can use URI-based expansion like in this demonstration\n\n\tcurl -XDELETE 'localhost:9200/test/'\n\n\tcurl -XPOST 'localhost:9200/test' -d '{\n\t  \"settings\" : {\n\t     \"index\" : {\n\t        \"analysis\" : {\n\t            \"filter\": {\n\t                \"skosfilter\" : {\n\t                    \"type\": \"skos\",\n\t                    \"indexName\" : \"ukat\",\n\t                    \"skosFile\": \"ukat_examples.n3\", \n\t                    \"expansionType\": \"URI\"\n\t                }\n\t            },\n\t            \"analyzer\" : {\n\t                \"skos\" : {\n\t                    \"type\" : \"custom\",\n\t                    \"tokenizer\" : \"keyword\",\n\t                    \"filter\" : \"skosfilter\"\n\t                }\n\t            }\n\t        }\n\t    }\n\t  },\n\t  \"mappings\" : {\n\t     \"_default_\" : {\n\t       \"properties\" : {\n\t         \"subject\" : {\n\t           \"type\" : \"string\",\n\t           \"analyzer\" : \"skos\",\n\t           \"search_analyzer\" : \"standard\"\n\t         }\n\t       }\n\t     }\n\t  }    \n\t}'\n\n\t# index test document\n\tcurl -XPUT 'localhost:9200/test/subjects/1' -d '{\n\t    \"title\" :  \"Spearhead\",\n\t    \"description\": \"Roman iron spearhead. The spearhead was attached to one end of a wooden shaft.The spear was mainly a thrusting weapon, but could also be thrown. It was the principal weapon of the auxiliary soldier. (second - fourth century, Arbeia Roman Fort)\",\n\t    \"subject\" : \"http://www.ukat.org.uk/thesaurus/concept/859\"\n\t}'\n\n\tcurl -XPOST 'localhost:9200/test/_refresh'\n\techo\n\n\t# should give one hit\n\tcurl -XGET 'localhost:9200/test/_search?pretty' -d '{\n\t      \"query\": {\n\t            \"term\" : {\n\t                  \"subject\": \"arms\"\n\t             }\n\t      }\n\t}'\n\techo\n\n\t# should give one hit\n\tcurl -XGET 'localhost:9200/test/_search?pretty' -d '{\n\t      \"query\": {\n\t            \"term\" : {\n\t                  \"subject\": \"weapons\"\n\t             }\n\t      }\n\t}'\n\techo\n\n    # should give one hit\n    curl -XGET 'localhost:9200/test/_search?pretty' -d '{\n          \"query\": {\n                \"term\" : {\n                      \"subject\": \"military equipment\"\n                 }\n          }\n    }'\n    echo\n\n\t# should give no hit\n\tcurl -XGET 'localhost:9200/test/_search?pretty' -d '{\n\t      \"query\": {\n\t            \"term\" : {\n\t                  \"subject\": \"nonsense\"\n\t             }\n\t      }\n\t}'\n\techo\n\nParameter overview\n------------------\n\nThe following settings parameters may be used in a filter of type *skos*\n\n\tindexName - a name for SKOS index\n\n\tskosFile - the name of the skos file with suffix .n3, .rdf, .ttl, .zip (mandatory)\n\n\texpansionType - URI or LABEL (mandatory)\n\n\tbufferSize - a buffer size for the number of words that will be checked for expansion\n\n\tlanguage - a language for the expansion\n\n\tskosType - a string with space-separated terms of PREF, ALT, HIDDEN, BROADER, NARROWER, BROADERTRANSITIVE, NARROWERTRANSITIVE, RELATED\n\t\n\n# License\n\nElasticsearch SKOS Plugin\n\nCopyright (C) 2013 Jörg Prante\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjprante%2Felasticsearch-analysis-skos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjprante%2Felasticsearch-analysis-skos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjprante%2Felasticsearch-analysis-skos/lists"}