Find predicates on an RDF whose structure forms a taxonomy, to be used in semantic measures.
npm install
How to run for a knowledge graph KG:
fuseki/data/kgs/$KGfuseki/data/kgs/$KG put your N-Triples file and name it $KG.nt(cd fuseki; ./run.sh)npm run proc-graph (results will be saved in proc-$KG-results.json)npm run graph-to-csv proc-$KG-results.json (results will be saved in results.csv)Run rdf-hektos for WordNet:
wordnet.nt file (you can find it gzipped here).fuseki/kgs/wordnet and move the wordnet.nt file there.(cd fuseki; ./run.sh). This might take a couple minutes. The wordnet.nt file will be loaded into Apache Jena and the Fuseki container will start.npm run proc-graph. This will take a minute and output results to wordnet-metrics.json.npm graph-to-csv wordnet-metrics.json. This will output results to results.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, {});
log-with-statusbar and ololog.Open a GitHub issue or, preferably, send me a pull request.
The MIT License (MIT)
Copyright (c) 2025 André Santos andrefs@andrefs.com
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.