{"id":15976441,"url":"https://github.com/danmichaelo/soksed","last_synced_at":"2025-06-26T13:34:43.942Z","repository":{"id":27917912,"uuid":"31409976","full_name":"danmichaelo/soksed","owner":"danmichaelo","description":"not-extremely portable RDF/SKOS-XL vocabulary editor, will not be developed further","archived":false,"fork":false,"pushed_at":"2023-01-02T07:46:14.000Z","size":2983,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T08:47:24.651Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danmichaelo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-27T08:22:02.000Z","updated_at":"2023-01-02T07:42:45.000Z","dependencies_parsed_at":"2023-01-14T07:44:42.349Z","dependency_job_id":null,"html_url":"https://github.com/danmichaelo/soksed","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmichaelo%2Fsoksed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmichaelo%2Fsoksed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmichaelo%2Fsoksed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danmichaelo%2Fsoksed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danmichaelo","download_url":"https://codeload.github.com/danmichaelo/soksed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240183763,"owners_count":19761440,"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-10-07T22:24:01.147Z","updated_at":"2025-02-22T13:59:28.146Z","avatar_url":"https://github.com/danmichaelo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nThis is a not-extremely portable RDF/SKOS-XL vocabulary editor using SPARQL UPDATE\nto store changes in a triple store. Instead of one editing\ninterface, it comes with multiple editing interfaces, where each interface is\noptimized for carrying out one or a few simple tasks. An interface consists of\na config entry, a  HTML template plus some supporting code. Current interfaces:\n\n* A \"Translation to Nynorsk\" view with input fields for entering terms\n  (`skos:prefLabel`, `skos:altLabel`) in Nynorsk\n  next to the non-editable Bokmål terms. 'Review' buttons for users with the\n  'review' right.\n* A view for categorizing concepts (`skos:member`) into a set of predefined\n  categories, translation terms to English and mapping to Wikidata.\n\n**State of this project**: The code quality is a little subpar since the editor\nwas made for a quite brief project that didn't need long term maintanability.\nEspecially, there's quite some configuration values, including namespaces,\nhardcoded here in the code that should have been moved into a config file for\nportability! If you have a project you would like to try out this editor with,\nlet me know and I might be able to assess if it could work or not,\nand perhaps fix some portability issues.\n\n\nExample data stored:\n\n```turtle\nPREFIX dct: \u003chttp://purl.org/dc/terms/\u003e\nPREFIX xsd: \u003chttp://www.w3.org/2001/XMLSchema#\u003e\nPREFIX skos: \u003chttp://www.w3.org/2004/02/skos/core#\u003e\nPREFIX xl: \u003chttp://www.w3.org/2008/05/skos-xl#\u003e\nPREFIX wd: \u003chttp://www.wikidata.org/entity/\u003e\nPREFIX real: \u003chttp://data.ub.uio.no/realfagstermer/\u003e\nPREFIX ubo: \u003chttp://data.ub.uio.no/onto#\u003e\nPREFIX users: \u003chttp://trans.biblionaut.net/data/users/\u003e\n\nreal:c003200\n\tubo:wikidataItem wd:Q83871 ;\n\tdct:modified \"2017-02-07T22:52:25.432+00:00\"^^xsd:dateTime ;\n    skos:member \u003chttp://data.ub.uio.no/entity/37f033b8-c77e-4fef-bdef-273f9065265d\u003e ;\n    xl:prefLabel real:t11d168ec-ed88-11e6-b958-024290857007 ;\n    xl:altLabel real:t1210dedc-ed88-11e6-abc1-024290857007 .\n\nreal:t1210dedc-ed88-11e6-abc1-024290857007\n\ta xl:Label ;\n\tdct:creator users:ed8973c8-c393-11e4-933b-f23c91890d47 ;\n\tdct:created \"2017-02-07T23:52:15+01:00\"^^xsd:dateTime ;\n\tdct:modified \"2017-02-07T23:52:15+01:00\"^^xsd:dateTime ;\n    xl:literalForm \"Benzos\"@en .\n```\n\n## Setup\n\nInstall dependencies:\n\n\t$ composer install\n\t$ npm install\n\t$ bower install\n\nStart development server:\n\n\t$ ./serve.sh \u0026\n\t$ gulp\n\nProduction build:\n\n\t$ gulp build\n\nCrontab for importing data from [realfagstermer/realfagstermer](https://github.com/realfagstermer/realfagstermer)\nand exporting to [realfagstermer/prosjekt-nynorsk](https://github.com/realfagstermer/prosjekt-nynorsk):\n\n\tPATH=PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/fuseki\n\tRUBYENV=/home/marco/.rvm/environments/ruby-2.2.0\n\t0 1 * * * /data/trans/export/export.sh 2\u003e\u00261 \n\t0 2 * * * /data/trans/import/update-fuseki.sh 2\u003e\u00261 \n\n## Users\n\nEveryone can self-register, but to edit you need to be granted\nthe \"edit\" and/or \"review\" permission. To grant permissions, run:\n\n```bash\n$ curl http://localhost:3030/ds/update --data-urlencode \"update@-\" \u003c\u003c EOF\nPREFIX ou: \u003chttp://trans.biblionaut.net/onto/user#\u003e\n\nINSERT\n{ GRAPH \u003chttp://trans.biblionaut.net/graph/users\u003e\n  { ?user ou:permission \"edit\", \"review\" }\n} WHERE\n{ GRAPH \u003chttp://trans.biblionaut.net/graph/users\u003e\n  {?user ou:username \"danmichaelo@gmail.com\" }\n}\nEOF\n```\n\nTo remove permissions:\n\n```bash\n$ curl http://localhost:3030/ds/update --data-urlencode \"update@-\" \u003c\u003c EOF\nPREFIX ou: \u003chttp://trans.biblionaut.net/onto/user#\u003e\n\nDELETE\n{ GRAPH \u003chttp://trans.biblionaut.net/graph/users\u003e\n  { ?user ou:permission \"edit\", \"review\" }\n} WHERE\n{ GRAPH \u003chttp://trans.biblionaut.net/graph/users\u003e\n  {?user ou:username \"danmichaelo@gmail.com\" }\n}\nEOF\n```\n\n## Create stats table\n\n```\nCREATE TABLE `stats` (\n  `id`  INTEGER PRIMARY KEY AUTOINCREMENT,\n  `date`  TEXT NOT NULL,\n  `metric` INTEGER NOT NULL,\n  `value` INTEGER NOT NULL,\n   UNIQUE (date, metric) ON CONFLICT REPLACE\n);\n```\n\n## Categories\n\nTo add the default categories:\n\n```\ncurl http://localhost:3030/ds/update --data-urlencode \"update@-\" \u003c\u003c EOF\nPREFIX uoc: \u003chttp://trans.biblionaut.net/class#\u003e\nPREFIX rdfs: \u003chttp://www.w3.org/2000/01/rdf-schema#\u003e\nPREFIX e: \u003chttp://data.ub.uio.no/entity/\u003e\nPREFIX g: \u003chttp://trans.biblionaut.net/graph/\u003e\n\nINSERT DATA\n{ GRAPH g:meta {\n\n\te:4d8d8554-b5f9-43be-a21e-46d058a3ee1c a uoc:Category ;\n\t\trdfs:label \"Generelt\"@nb .\n\n\te:d5a885cd-56a0-4501-9c99-418db3fbcbdb a uoc:Category ;\n\t\trdfs:label \"Astro\"@nb .\n\n\te:c331c5e9-726c-4c55-9341-72d3e7874d6b a uoc:Category ;\n\t\trdfs:label \"Fysikk\"@nb .\n\n\te:8dce39ea-409f-4072-b25b-377a69bca0a3 a uoc:Category ;\n\t\trdfs:label \"Biologi\"@nb .\n\n\te:e31b973e-b1b4-4768-9d47-4151aa54fefd a uoc:Category ;\n\t\trdfs:label \"Geo\"@nb .\n\n\te:37f033b8-c77e-4fef-bdef-273f9065265d a uoc:Category ;\n\t\trdfs:label \"Farmasi\"@nb .\n\n\te:4d8d7781-2753-4d38-9ef9-de6c8cea4107 a uoc:Category ;\n\t\trdfs:label \"Kjemi\"@nb .\n\n\te:c0f08a3c-12ed-410a-b810-d8be5c48571b a uoc:Category ;\n\t\trdfs:label \"Informatikk\"@nb .\n\n\te:aa780674-ac5f-40b2-a5a6-7912901f6d5f a uoc:Category ;\n\t\trdfs:label \"Matematikk\"@nb .\n\n}}\nEOF\n```\n\nTo remove all categories:\n\n```\ncurl http://localhost:3030/ds/update --data-urlencode \"update@-\" \u003c\u003c EOF\nPREFIX uoc: \u003chttp://trans.biblionaut.net/class#\u003e\nPREFIX rdfs: \u003chttp://www.w3.org/2000/01/rdf-schema#\u003e\nPREFIX g: \u003chttp://trans.biblionaut.net/graph/\u003e\n\nDELETE WHERE {\n  GRAPH g:meta {\n  \t?x a uoc:Category ;\n\t\t   rdfs:label ?lab .\n  }\n}\n\nEOF\n```\n\n## Export\n\n```\ncd export \u0026\u0026 ./export.sh\n```\n\nSimple export:\n\n```\nGRAPH=http://trans.biblionaut.net/graph/trans2\ncurl -X GET -o export.ttl -s -H \"Content-Type: text/turtle\" -G --data-urlencode \"graph=$GRAPH\" \"http://localhost:3030/ds/get\"\n```\n\n## Log\n\n```\n\u003chttp://trans.biblionaut.net/data/log/0000-0000-0000-0000\u003e a uoc:Event ;\n\tdct:date \"2016-01-01T00:00:00\"^xsd:datetime ;\n\tuop:user \u003chttp://trans.biblionaut.net/data/users/1\u003e ;\n\tuop:concept \u003chttp://data.ub.uio.no/realfagstermer/c123\u003e ;\n\tuop:data \"free text\" .\n```\n\n## Various SPARQL queries\n\nList \"nb\" terms that have leaked into the trans graph:\n\n```bash\n$ curl http://localhost:3030/ds/query --data-urlencode \"query@-\" \u003c\u003c EOF\nPREFIX ou: \u003chttp://trans.biblionaut.net/onto/user#\u003e\nPREFIX xl: \u003chttp://www.w3.org/2008/05/skos-xl#\u003e\nPREFIX g: \u003chttp://trans.biblionaut.net/graph/\u003e\n\nSELECT ?label ?prop ?value\nWHERE {\n  GRAPH g:trans {\n    ?label a xl:Label ;\n   \t\txl:literalForm ?term .\n   \t{\n   \t\t{ ?label ?prop ?value .}\n   \t\tUNION\n   \t\t{ ?a ?b ?label . }\n   \t}\n   \tFILTER (langMatches(lang(?term), \"nb\"))\n  }\n}\nEOF\n```\n\n... and delete them:\n\n```bash\n$ curl http://localhost:3030/ds/update --data-urlencode \"update@-\" \u003c\u003c EOF\nPREFIX ou: \u003chttp://trans.biblionaut.net/onto/user#\u003e\nPREFIX xl: \u003chttp://www.w3.org/2008/05/skos-xl#\u003e\nPREFIX g: \u003chttp://trans.biblionaut.net/graph/\u003e\n\nDELETE\n{ GRAPH g:trans {\n    ?a ?b ?label .\n    ?label ?prop ?value .\n  }\n}\nWHERE\n{\n  GRAPH g:trans {\n    ?label a xl:Label ;\n   \t\txl:literalForm ?term .\n   \t{\n   \t\t{ ?label ?prop ?value .}\n   \t\tUNION\n   \t\t{ ?a ?b ?label . }\n   \t}\n   \tFILTER (langMatches(lang(?term), \"nb\"))\n  }\n}\nEOF\n```\n\nList mappings:\n\n```\n$ curl http://localhost:3030/ds/query --data-urlencode \"query@-\" \u003c\u003c EOF\nPREFIX ou: \u003chttp://trans.biblionaut.net/onto/user#\u003e\nPREFIX xl: \u003chttp://www.w3.org/2008/05/skos-xl#\u003e\nPREFIX g: \u003chttp://trans.biblionaut.net/graph/\u003e\nPREFIX ubo: \u003chttp://data.ub.uio.no/onto#\u003e\n\nSELECT ?c ?wd\nWHERE {\n  GRAPH g:trans2 {\n    ?c ubo:wikidataItem ?wd .\n  }\n}\nEOF\n```\n\nMove mappings to new graph:\n\n```bash\n$ curl http://localhost:3030/ds/update --data-urlencode \"update@-\" \u003c\u003c EOF\nPREFIX ou: \u003chttp://trans.biblionaut.net/onto/user#\u003e\nPREFIX xl: \u003chttp://www.w3.org/2008/05/skos-xl#\u003e\nPREFIX g: \u003chttp://trans.biblionaut.net/graph/\u003e\nPREFIX ubo: \u003chttp://data.ub.uio.no/onto#\u003e\n\nDELETE { GRAPH g:trans {\n  ?c ubo:wikidataItem ?wd .\n}}\nINSERT { GRAPH g:trans2 {\n  ?c ubo:wikidataItem ?wd .\n}}\nWHERE { GRAPH g:trans {\n  ?c ubo:wikidataItem ?wd .\n}}\nEOF\n```\n\n\nList concepts with more than one mapping:\n\n```\n$ curl http://localhost:3030/ds/query --data-urlencode \"query@-\" \u003c\u003c EOF\nPREFIX ou: \u003chttp://trans.biblionaut.net/onto/user#\u003e\nPREFIX xl: \u003chttp://www.w3.org/2008/05/skos-xl#\u003e\nPREFIX g: \u003chttp://trans.biblionaut.net/graph/\u003e\nPREFIX ubo: \u003chttp://data.ub.uio.no/onto#\u003e\n\nSELECT ?c ?wd\nWHERE {\n  GRAPH g:trans2 {\n    ?c ubo:wikidataItem ?wd ;\n    \tubo:wikidataItem ?wd2 .\n    FILTER(?wd \u003c ?wd2)\n  }\n}\nEOF\n```\n\n\nIf the lock status gets out of sync:\n\n```\ncurl -s http://localhost:3030/ds/update --data-urlencode \"update@-\" \u003c fix_lock.rq\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanmichaelo%2Fsoksed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanmichaelo%2Fsoksed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanmichaelo%2Fsoksed/lists"}