diff --git a/Cargo.toml b/Cargo.toml
index 9898b26..788203c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,6 +23,10 @@ path = "src/map/step_04.rs"
name = "step-05"
path = "src/map/step_05.rs"
+[[bin]]
+name = "step-06"
+path = "src/map/step_06.rs"
+
[dependencies]
sophia = "0.9"
oxigraph = "*"
diff --git a/Rakefile b/Rakefile
index ebefaae..cab6a00 100644
--- a/Rakefile
+++ b/Rakefile
@@ -91,6 +91,12 @@ file 'data/graph-05.ttl' => ['data/graph-04.ttl'] + UPDATE_QUERIES_STEP05 do
sh 'step-05'
end
+CONSTRUCT_QUERIES_STEP06 = FileList['constructs_step06/*.rq']
+
+file 'data/graph-06.ttl' => ['data/graph-05.ttl'] + CONSTRUCT_QUERIES_STEP06 do
+ sh 'step-06'
+end
+
# ── Examples ─────────────────────────────────────────────────────────────────
SPARQL = File.expand_path('~/.cargo/bin/sparql')
@@ -135,6 +141,14 @@ file 'data_examples/step_05_2hop.ttl' => ['data/graph-05.ttl', 'queries/step_05_
sh "#{SPARQL} queries/step_05_2hop_example.rq --graph data/graph-05.ttl --prettify > data_examples/step_05_2hop.ttl"
end
+file 'data_examples/step_06_1hop.ttl' => ['data/graph-06.ttl', 'queries/step_06_1hop_example.rq'] do
+ sh "#{SPARQL} queries/step_06_1hop_example.rq --graph data/graph-06.ttl --prettify > data_examples/step_06_1hop.ttl"
+end
+
+file 'data_examples/step_06_2hop.ttl' => ['data/graph-06.ttl', 'queries/step_06_2hop_example.rq'] do
+ sh "#{SPARQL} queries/step_06_2hop_example.rq --graph data/graph-06.ttl --prettify > data_examples/step_06_2hop.ttl"
+end
+
# ── Aggregate tasks ──────────────────────────────────────────────────────────
GENERATED = %w[
@@ -159,6 +173,7 @@ GRAPHS = %w[
data/graph-03.ttl
data/graph-04.ttl
data/graph-05.ttl
+ data/graph-06.ttl
].freeze
EXAMPLES = %w[
@@ -172,6 +187,8 @@ EXAMPLES = %w[
data_examples/step_04_2hop.ttl
data_examples/step_05_1hop.ttl
data_examples/step_05_2hop.ttl
+ data_examples/step_06_1hop.ttl
+ data_examples/step_06_2hop.ttl
].freeze
task examples: EXAMPLES
diff --git a/constructs_step06/010a-occupations-passthrough.rq b/constructs_step06/010a-occupations-passthrough.rq
new file mode 100644
index 0000000..34b32de
--- /dev/null
+++ b/constructs_step06/010a-occupations-passthrough.rq
@@ -0,0 +1,12 @@
+# Construct occupation instances: pass through existing schema:Occupation.
+
+PREFIX schema:
+
+CONSTRUCT {
+ ?s a schema:Occupation .
+ ?s schema:name ?name .
+}
+WHERE {
+ ?s a schema:Occupation .
+ OPTIONAL { ?s schema:name ?name }
+}
diff --git a/constructs_step06/010-occupations.rq b/constructs_step06/010b-occupations-from-profession.rq
similarity index 61%
rename from constructs_step06/010-occupations.rq
rename to constructs_step06/010b-occupations-from-profession.rq
index 220cdac..7199c99 100644
--- a/constructs_step06/010-occupations.rq
+++ b/constructs_step06/010b-occupations-from-profession.rq
@@ -1,21 +1,10 @@
-# Construct occupation instances.
-# Existing schema:Occupation instances pass through.
-# migrants:Profession instances are retyped as schema:Occupation.
+# Construct occupation instances: retype migrants:Profession as schema:Occupation.
PREFIX rdfs:
PREFIX skos:
PREFIX schema:
PREFIX migrants:
-CONSTRUCT {
- ?s a schema:Occupation .
- ?s schema:name ?name .
-}
-WHERE {
- ?s a schema:Occupation .
- OPTIONAL { ?s schema:name ?name }
-}
-;
CONSTRUCT {
?s a schema:Occupation .
?s a skos:Concept .
diff --git a/data/graph-06.ttl b/data/graph-06.ttl
new file mode 100644
index 0000000..bbe2569
--- /dev/null
+++ b/data/graph-06.ttl
@@ -0,0 +1,147687 @@
+ a , ;
+ "Tau Cooperation"@en .
+ a , ;
+ "Own"@en .
+ a , ;
+ "Permanent"@en ;
+ "Permanent"@en .
+ a , ;
+ "Tour"@en ;
+ "Tour"@en .
+ a , ;
+ "Guest"@en ;
+ "Guest"@en .
+ a , ;
+ "Other"@en ;
+ "Other"@en .
+ a , ;
+ "Itinerant"@en ;
+ "Itinerant"@en .
+ a , ;
+ "Christian"@en ;
+ "Christian"@en .
+ a , ;
+ "Jewish"@en ;
+ "Jewish"@en .
+ a , ;
+ "Other"@en ;
+ "Other"@en .
+ a , ;
+ "Other"@en ;
+ "Other"@en .
+ a , ;
+ "Daughter"@en ;
+ "Daughter"@en .
+ a , ;
+ "Wife"@en ;
+ "Wife"@en .
+ a , ;
+ "Niece"@en ;
+ "Niece"@en .
+ a , ;
+ "Nephew"@en ;
+ "Nephew"@en .
+ a , ;
+ "Sister"@en ;
+ "Sister"@en .
+ a , ;
+ "Son"@en ;
+ "Son"@en .
+ a , ;
+ "Father"@en ;
+ "Father"@en .
+ a , ;
+ "Mother"@en ;
+ "Mother"@en .
+ a , ;
+ "Cousin"@en ;
+ "Cousin"@en .
+ a , ;
+ "Husband"@en ;
+ "Husband"@en .
+ a , ;
+ "Grandfather"@en ;
+ "Grandfather"@en .
+ a , ;
+ "Brother"@en ;
+ "Brother"@en .
+ a , ;
+ "Grandmother"@en ;
+ "Grandmother"@en .
+ a , ;
+ "Aunt"@en ;
+ "Aunt"@en .
+ a , ;
+ "Fiance"@en ;
+ "Fiance"@en .
+ a , ;
+ "Uncle"@en ;
+ "Uncle"@en .
+ a , ;
+ "Fiancee"@en ;
+ "Fiancee"@en .
+ a , ;
+ "family"@en ;
+ "family"@en .
+ a , ;
+ "friendship"@en ;
+ "friendship"@en .
+ a , ;
+ "work"@en ;
+ "work"@en .
+ a , ;
+ "student"@en ;
+ "student"@en .
+ a , ;
+ "other"@en ;
+ "other"@en .
+ a , ;
+ "teacher"@en ;
+ "teacher"@en .
+ a , ;
+ "trained_together"@en ;
+ "trained_together"@en .
+ a , .
+ a , .
+ a , ;
+ "Marriage"@en ;
+ "Marriage"@en .
+ a , ;
+ "Birth name"@en ;
+ "Birth name"@en .
+ a , ;
+ "Migration-Related"@en ;
+ "Migration-Related"@en .
+ a , ;
+ "Other"@en ;
+ "Other"@en .
+ a , ;
+ "Pseudonym/Stage name"@en ;
+ "Pseudonym/Stage name"@en .
+ a , ;
+ "Migration-related"@en ;
+ "Migration-related"@en .
+ a , ;
+ "Theatre"@en ;
+ "Theatre"@en .
+ a , ;
+ "Other"@en ;
+ "Other"@en .
+ a , ;
+ "Traveling Company"@en ;
+ "Traveling Company"@en .
+ a , ;
+ "Printed Media"@en ;
+ "Printed Media"@en .
+ a , ;
+ "Amateur"@en ;
+ "Amateur"@en .
+ a , ;
+ "Education (Theatre related)"@en ;
+ "Education (Theatre related)"@en .
+ a , ;
+ "Kleinkunst"@en ;
+ "Kleinkunst"@en .
+ a , ;
+ "Society/Union"@en ;
+ "Society/Union"@en .
+ a , ;
+