Find predicates on an RDF whose structure forms a taxonomy, to be used in semantic measures.
- docker
- Apache Jena (tdb2.tdbloader)
npm install
How to run for a knowledge graph KG:
- Create a folder on
fuseki/data/kgs/$KG - Inside
fuseki/data/kgs/$KGput your N-Triples file and name it$KG.nt (cd fuseki; ./run.sh)npm run proc-graph(results will be saved inproc-$KG-results.json)npm run graph-to-csvproc-$KG-results.json (results will be saved inresults.csv)
Run rdf-hektos for WordNet:
- Download the
wordnet.ntfile (you can find it gzipped here). - Unzip it if you need to.
- Create the folder on
fuseki/kgs/wordnetand move thewordnet.ntfile there. - Run
(cd fuseki; ./run.sh). This might take a couple minutes. Thewordnet.ntfile will be loaded into Apache Jena and the Fuseki container will start. - You should now be able to access WordNet on Fuseki at http://localhost:3030.
- You can now run:
npm run proc-graph. This will take a minute and output results towordnet-metrics.json.npm graph-to-csv wordnet-metrics.json. This will output results toresults.csv.
import { SparqlWebStore, roisToSubQ, procGraph } from "rdf-hektos";
const rois = ["http://example.org/A", "http://example.org/B"];
const subQ = roisToSubQ(rois, "s");
const endpointUrl = "http://localhost:3030/dataset/sparql";
const store = new SparqlWebStore({ endpointUrl });
const res = await procGraph(store, subQ, {});- Better integration of logs and progress bars with
log-with-statusbarandololog.
Open a GitHub issue or, preferably, send me a pull request.
The MIT License (MIT)
Copyright (c) 2025 André Santos [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.