From ae0bacec381580d5c38c47381df1a3fa8a92b18f Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Fri, 2 Sep 2022 10:38:44 -0400 Subject: [PATCH] Replace glom_graph.py with rdfpipe This is a downstream application of the intent of UCO Issue 424, removing an early implementation of glom_graph. References: * https://github.com/ucoProject/UCO/issues/424 Signed-off-by: Alex Nelson --- tests/case_utils/case_file/Makefile | 8 +++---- tests/src/glom_graph.py | 37 ----------------------------- 2 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 tests/src/glom_graph.py diff --git a/tests/case_utils/case_file/Makefile b/tests/case_utils/case_file/Makefile index 1f55f1d..254a27d 100644 --- a/tests/case_utils/case_file/Makefile +++ b/tests/case_utils/case_file/Makefile @@ -61,15 +61,15 @@ kb.json: \ mv _$@ $@ kb.ttl: \ - $(tests_srcdir)/src/glom_graph.py \ sample.txt.ttl \ sample.txt-disable_hashes.ttl \ sample.txt-nocompact.json source $(tests_srcdir)/venv/bin/activate \ - && python3 $(tests_srcdir)/src/glom_graph.py \ - __$@ \ + && rdfpipe \ + --output-format turtle \ sample.txt.ttl \ - sample.txt-disable_hashes.ttl + sample.txt-disable_hashes.ttl \ + > __$@ java -jar $(RDF_TOOLKIT_JAR) \ --infer-base-iri \ --inline-blank-nodes \ diff --git a/tests/src/glom_graph.py b/tests/src/glom_graph.py deleted file mode 100644 index e54d8ed..0000000 --- a/tests/src/glom_graph.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python3 - -# This software was developed at the National Institute of Standards -# and Technology by employees of the Federal Government in the course -# of their official duties. Pursuant to title 17 Section 105 of the -# United States Code this software is not subject to copyright -# protection and is in the public domain. NIST assumes no -# responsibility whatsoever for its use by other parties, and makes -# no guarantees, expressed or implied, about its quality, -# reliability, or any other characteristic. -# -# We would appreciate acknowledgement if the software is used. - -""" -This script takes multiple input JSON-LD or Turtle files and emits a single Turtle graph. -""" - -__version__ = "0.2.1" - -import rdflib - - -def main() -> None: - g = rdflib.Graph() - for in_graph in args.in_graph: - g.parse(in_graph) - g.serialize(args.out_graph) - - -if __name__ == "__main__": - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument("out_graph") - parser.add_argument("in_graph", nargs="*") - args = parser.parse_args() - main()