Przeglądaj źródła

WIP: separate base and extension schemata for core types.

Stefano Cossu 5 dni temu
rodzic
commit
cd9b3bcaf3

+ 0 - 0
config/model/typedef/agent.lua → config/model/schema/agent.lua


+ 33 - 0
config/model/schema/anything.lua

@@ -0,0 +1,33 @@
+return {
+    core = true,
+
+    properties = {
+        ext_id = {
+            uri = "dc:identifier",
+            label = "External system ID",
+            type = "string",
+        },
+        alt_label = {
+            uri = "dc:alternative",
+            label = "Alternative Label",
+            type = "string",
+        },
+        description = {
+            uri = "dc:description",
+            label = "Description",
+            type = "string",
+        },
+        last_modified_by = {
+            uri = "dc:contributor",
+            label = "Last Updated By",
+            type = "rel",
+            range = {agent = true},
+        },
+        submitted_by = {
+            uri = "dc:creator",
+            label = "Submitted By",
+            type = "rel",
+            range = {agent = true},
+        },
+    },
+}

+ 24 - 0
config/model/schema/artifact.lua

@@ -0,0 +1,24 @@
+return {
+    core = true,
+
+    properties = {
+        date = {
+            uri = "pas:date",
+            label = "Date",
+            description = "Date related to the artifact.",
+            type = "string",
+        },
+        location_descr = {
+            uri = "pas:locationDescription",
+            label = "Location description",
+            description = "Verbal description of the artifact's location.",
+            type = "string",
+        },
+        location_url = {
+            uri = "pas:locationUrl",
+            label = "Geolocation URL",
+            description = "Link to a map locating the artifact.",
+            type = "string",
+        },
+    },
+}

+ 1 - 12
config/model/typedef/collection.lua → config/model/schema/collection.lua

@@ -1,8 +1,5 @@
 return {
-    uri = "pas:Collection",
-    label = "Collection",
-
-    broader = "brick",
+    core = true,
 
     properties = {
         pref_rep = {
@@ -14,14 +11,6 @@ return {
             type = "resource",
             range = {file = true},
         },
-        long_description = {
-            uri = "pas:longDescription",
-            label = "Long description",
-            description = "Text document in Markdown format with a detailed \z
-                description of the collection.",
-            type = "resource",
-            range = {file = true},
-        },
     }
 }
 

+ 0 - 0
config/model/typedef/document.lua → config/model/schema/document.lua


+ 12 - 0
config/model/schema/file.lua

@@ -0,0 +1,12 @@
+return {
+    core = true,
+
+    properties = {
+        thumbnail = {
+            uri = "pas:thumbnail",
+            label = "Thumbnail",
+            type = "string",
+            max_cardinality = 1,
+        },
+    }
+}

+ 0 - 0
config/model/typedef/part.lua → config/model/schema/part.lua


+ 0 - 0
config/model/typedef/postcard.lua → config/model/schema/postcard.lua


+ 0 - 0
config/model/typedef/proxy.lua → config/model/schema/proxy.lua


+ 0 - 0
config/model/typedef/still_image.lua → config/model/schema/still_image.lua


+ 0 - 0
config/model/typedef/still_image_file.lua → config/model/schema/still_image_file.lua


+ 1 - 1
doc/roadmap.md

@@ -68,7 +68,7 @@ usage and opportunities for expanding adoption in relevant areas.
   - ✓ Generate content model documentation (HTML)
   - ❏ Multilingual support
   - ✓ Content model dump (CLI)
-  -  Local overrides
+  -  Local overrides
 - ⚒ Presentation
   - ⎊ Generate site for one collection only
   - ✓ Generate LL for submission

+ 6 - 34
config/model/typedef/anything.lua → src/core_schema/anything.lua

@@ -2,7 +2,7 @@ return {
     uri = "pas:Anything",
     label = "Anything",
     description = "Superclass of every resource type in the system.",
-    abstract = "true",
+    abstract = true,
 
     properties = {
         source_path = {
@@ -13,6 +13,7 @@ return {
                 root.",
             type = "string",
             max_cardinality = 1,
+            system = true,
         },
         content_type = {
             uri = "pas:contentType",
@@ -20,6 +21,7 @@ return {
             type = "resource",
             min_cardinality = 1,
             max_cardinality = 1,
+            system = true,
         },
         --[[
         id = {
@@ -37,11 +39,7 @@ return {
                 was created or updated in.",
             type = "resource",
             min_cardinality = 1,
-        },
-        ext_id = {
-            uri = "dc:identifier",
-            label = "External system ID",
-            type = "string",
+            system = true,
         },
         label = {
             uri = "dc:title",
@@ -49,22 +47,13 @@ return {
             type = "string",
             max_cardinality = 1,
         },
-        alt_label = {
-            uri = "dc:alternative",
-            label = "Alternative Label",
-            type = "string",
-        },
-        description = {
-            uri = "dc:description",
-            label = "Description",
-            type = "string",
-        },
         submitted = {
             uri = "dc:dateSubmitted",
             label = "Submitted On",
             type = "datetime",
             min_cardinality = 1,
             max_cardinality = 1,
+            system = true,
         },
         last_modified = {
             uri = "dc:modified",
@@ -72,24 +61,7 @@ return {
             type = "datetime",
             min_cardinality = 1,
             max_cardinality = 1,
-        },
-        submitted_by = {
-            uri = "dc:creator",
-            label = "Submitted By",
-            type = "rel",
-            range = {agent = true},
-        },
-        created_by = {
-            uri = "dc:creator",
-            label = "Created By",
-            type = "rel",
-            range = {agent = true},
-        },
-        last_modified_by = {
-            uri = "dc:contributor",
-            label = "Last Updated By",
-            type = "rel",
-            range = {agent = true},
+            system = true,
         },
     },
 }

+ 4 - 9
config/model/typedef/artifact.lua → src/core_schema/artifact.lua

@@ -15,6 +15,7 @@ return {
             label = "First child",
             type = "resource",
             range = {brick = true},
+            system = true,
         },
         pref_rep = {
             uri = "pas:hasPreferredRepresentation",
@@ -37,16 +38,10 @@ return {
             description = "Date related to the artifact.",
             type = "string",
         },
-        location_descr = {
+        location = {
             uri = "pas:locationDescription",
-            label = "Location description",
-            description = "Verbal description of the artifact's location.",
-            type = "string",
-        },
-        location_url = {
-            uri = "pas:locationUrl",
-            label = "Geolocation URL",
-            description = "Link to a map locating the artifact.",
+            label = "Location",
+            description = "Generic information about the artifact's location.",
             type = "string",
         },
     },

+ 0 - 0
config/model/typedef/brick.lua → src/core_schema/brick.lua


+ 16 - 0
src/core_schema/collection.lua

@@ -0,0 +1,16 @@
+return {
+    core = true,
+
+    properties = {
+        long_description = {
+            uri = "pas:longDescription",
+            label = "Long description",
+            description = "Text document in Markdown format with a detailed \z
+                description of the collection.",
+            type = "resource",
+            range = {file = true},
+        },
+    }
+}
+
+

+ 0 - 7
config/model/typedef/file.lua → src/core_schema/file.lua

@@ -18,13 +18,6 @@ return {
             range = {Part = true, File = true},
             max_cardinality = 1,
         },
-        thumbnail = {
-            uri = "pas:thumbnail",
-            label = "Thumbnail",
-            type = "string",
-            --min_cardinality = 1,
-            max_cardinality = 1,
-        },
         format = {
             uri = "dc:format",
             label = "MIME type",

+ 0 - 4
src/repo.lua

@@ -68,10 +68,6 @@ end
 --[[--
 Dump the whole archive RDF to a file stream.
 
-The result is a software-agnostic RDF representation of the metadata
-(Turtle) compressed with GZip. The ores data folder can be backed up via
-OS-level file operations.
-
 The restore() function, combined with a copy of
 the ores folder, shall create a fully functional repo.