Skip to content

Commit 6104de2

Browse files
committed
Base example repository on building off of UCO-Profile-Example
A follow-on patch will regenerate Make-managed files. Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
1 parent ff3da28 commit 6104de2

File tree

12 files changed

+43
-124
lines changed

12 files changed

+43
-124
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
path = dependencies/CASE
33
url = https://github.com/casework/CASE.git
44
branch = master
5+
[submodule "dependencies/UCO-Profile-Example"]
6+
path = dependencies/UCO-Profile-Example
7+
url = https://github.com/ucoProject/UCO-Profile-Example.git
8+
branch = main

CONTRIBUTE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ To create a new profile repository for the ontology with short name `Foo`, we su
1818
1. Substitute all references to the "example" ontology with the desired ontology. Generally, this is handled by:
1919
1. Update the [README](README.md) to change the name of the repository. (Minimally, the title line should be revised.)
2020
1. Addressing the "TODOs" in [`dependencies/Makefile`](dependencies/Makefile)
21+
1. Updating the submodule pointer to the UCO profile for the external ontology. The example given is that [`CASE-Profile-Example`](https://github.com/casework/CASE-Profile-Example)'s profile ontology `owl:import`s [`UCO-Profile-Example`](https://github.com/ucoProject/UCO-Profile-Example)'s profile ontology for the Example Ontology, with the UCO profile file tracked by Git submodule.
2122
1. Updating the TSV files under [`etc/`](etc/). This is to support local-file editing with some ontology tooling (developed for [UCO Issue 449](https://github.com/ucoProject/UCO/issues/449)). [These lines](https://github.com/ucoProject/UCO/blob/1.2.0/src/create-catalog-v001.xml.py#L68-L77) describe the file formats.
2223
1. Renaming the [ontology file under `/ontology`](ontology/case-example.ttl), and updating its contents.
2324
1. Renaming the [shapes file under `/shapes`](shapes/sh-case-example.ttl), and updating its contents. If the profile does not require shapes, the directory `shapes` can be removed.

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ all: \
4848
.git_submodule_init_imports.done.log
4949
git submodule update \
5050
--init
51+
# Import profile's non-CDO submodules.
52+
# TODO - Adapt UCO-Profile-Example reference if this CASE
53+
# profile builds on a UCO profile.
54+
$(MAKE) \
55+
--directory dependencies/UCO-Profile-Example \
56+
.git_submodule_init_imports.done.log
5157
$(MAKE) \
5258
--directory dependencies/CASE \
5359
.git_submodule_init.done.log \

dependencies/Makefile

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ $(RDF_TOOLKIT_JAR):
3333
@test -r $@
3434

3535
catalog-v001.xml: \
36+
$(case_srcdir)/ontology/master/catalog-v001.xml \
3637
$(top_srcdir)/.venv.done.log \
3738
$(top_srcdir)/etc/domain_directories.tsv \
3839
$(top_srcdir)/etc/dependency_files.tsv \
@@ -41,6 +42,7 @@ catalog-v001.xml: \
4142
rm -f _$@
4243
source $(top_srcdir)/venv/bin/activate \
4344
&& python3 $(uco_srcdir)/src/create-catalog-v001.xml.py \
45+
--catalog-xml $(case_srcdir)/ontology/master/catalog-v001.xml \
4446
_$@ \
4547
$(top_srcdir)/etc/domain_directories.tsv \
4648
$(top_srcdir)/etc/dependency_files.tsv \
@@ -56,27 +58,8 @@ check: \
5658
clean:
5759
@rm -f \
5860
catalog-v001.xml \
59-
example.ttl \
6061
imports-transitive.ttl
6162

62-
# TODO: Adapt this recipe to normalize a submodule's file, or downloaded
63-
# file, in the same manner as CDO ontologies are normalized.
64-
example.ttl: \
65-
example/example.owl \
66-
$(RDF_TOOLKIT_JAR) \
67-
$(top_srcdir)/.venv.done.log
68-
source $(top_srcdir)/venv/bin/activate \
69-
&& pyshacl \
70-
--shacl $(uco_srcdir)/ontology/owl/owl.ttl \
71-
$<
72-
java -jar $(RDF_TOOLKIT_JAR) \
73-
--inline-blank-nodes \
74-
--source $< \
75-
--source-format rdf-xml \
76-
--target _$@ \
77-
--target-format turtle
78-
mv _$@ $@
79-
8063
# This recipe intentionally does not incorporate CDO ontologies (UCO,
8164
# CASE, etc.), to avoid redundant imports between multiple profiles.
8265
# TODO: Adapt this recipe to depend instead on the normalized file, as
@@ -85,7 +68,9 @@ example.ttl: \
8568
# command but for RDF graph files, will combine all recipe dependencies
8669
# into one file, using the $^ ("all dependencies") Make variable.
8770
imports-transitive.ttl: \
88-
example.ttl
71+
UCO-Profile-Example/dependencies/example.ttl \
72+
UCO-Profile-Example/dependencies/imports-transitive.ttl \
73+
UCO-Profile-Example/ontology/uco-example.ttl
8974
source $(top_srcdir)/venv/bin/activate \
9075
&& rdfpipe \
9176
--output-format turtle \

dependencies/UCO-Profile-Example

Submodule UCO-Profile-Example added at 9d0b780

dependencies/example.ttl

Lines changed: 0 additions & 16 deletions
This file was deleted.

dependencies/example/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

dependencies/example/example.owl

Lines changed: 0 additions & 18 deletions
This file was deleted.

etc/dependency_files.tsv

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
http://example.org/ontology/example/0.0.1 ${top_srcdir}/dependencies/example.ttl
2-
http://example.org/shapes/sh-uco-example ${top_srcdir}/shapes/sh-uco-example.ttl
1+
http://example.org/ontology/example/0.0.1 ${top_srcdir}/dependencies/UCO-Profile-Example/dependencies/example.ttl
2+
http://example.org/ontology/uco-example ${top_srcdir}/dependencies/UCO-Profile-Example/ontology/uco-example.ttl
3+
http://example.org/shapes/sh-case-example ${top_srcdir}/shapes/sh-case-example.ttl
4+
http://example.org/shapes/sh-uco-example ${top_srcdir}/dependencies/UCO-Profile-Example/shapes/sh-uco-example.ttl

ontology/case-example.ttl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# imports: http://example.org/ontology/example/0.0.1
1+
# imports: http://example.org/ontology/uco-example
22
# imports: https://ontology.caseontology.org/case/case/1.3.0
33

44
@prefix drafting: <http://example.org/ontology/drafting/> .
@@ -12,7 +12,7 @@
1212
<http://example.org/ontology/case-example>
1313
a owl:Ontology ;
1414
owl:imports
15-
ex:0.0.1 ,
15+
<http://example.org/ontology/uco-example> ,
1616
<https://ontology.caseontology.org/case/case/1.3.0>
1717
;
1818
.

0 commit comments

Comments
 (0)