[Volute] r5264 - trunk/projects/semantics/vocabularies

Volute commit messages volutecommits at g-vo.org
Tue Dec 11 14:50:13 CET 2018


Author: msdemlei
Date: Tue Dec 11 14:50:11 2018
New Revision: 5264

Log:
vocabularies: Explanation for deployment

(and some minor fixes to actually make it work; and forgotten vocabs.conf)

Added:
   trunk/projects/semantics/vocabularies/Makefile
   trunk/projects/semantics/vocabularies/vocabs.conf
Modified:
   trunk/projects/semantics/vocabularies/   (props changed)
   trunk/projects/semantics/vocabularies/README
   trunk/projects/semantics/vocabularies/convert.py

Added: trunk/projects/semantics/vocabularies/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/projects/semantics/vocabularies/Makefile	Tue Dec 11 14:50:11 2018	(r5264)
@@ -0,0 +1,18 @@
+all: clean vocabs.conf
+	python convert.py vocabs.conf
+
+dist.tar.gz: all
+	tar -cvzf $@ $(BUILT_DIRS)
+
+FAIL = $(error "Need to define ROOT_URI for make local")
+
+local: clean
+ifdef ROOT_URI
+	python convert.py --root-uri $(ROOT_URI) vocabs.conf
+	(cd build; tar -cvzf ../local.tar.gz *)
+else
+	$(FAIL)
+endif
+
+clean:
+	rm -rf build

Modified: trunk/projects/semantics/vocabularies/README
==============================================================================
--- trunk/projects/semantics/vocabularies/README	Tue Dec 11 11:57:20 2018	(r5263)
+++ trunk/projects/semantics/vocabularies/README	Tue Dec 11 14:50:11 2018	(r5264)
@@ -109,3 +109,30 @@
   Persons involved with the creation of the standard.  These are *not*
   the persons to ask for maintenance; all requests for changes should be
   directed to the semantics working group.
+
+
+Deployment
+==========
+
+To have a local installation, decide on a location from where you'll
+serve your vocabularies; since we currently generate apache .htaccess
+files only, this should be served by an apache HTTP server.  Then, call
+``make local`` with ROOT_URI set to that root URL, e.g.,::
+
+  python convert.py --root-uri http://docs.g-vo.org/rdf vocabs.conf
+
+The result of this is a file local.tar.gz.  Move that to the directory
+corresponding to the ROOT_URI and ``tar -xvzf`` it.
+
+In order for the .htaccess configuration to work, that directory (or one
+of its ancestors) has to be configured to interpret FileInfo
+content.  This would look like this::
+
+    <Directory /var/www/docs/rdf>
+          AllowOverride FileInfo
+    </Directory>
+
+Also, mod_rewrite must be enabled.
+
+You will then see the hierarchy of the vocabularies.  Clicking on a link
+to a vocabulary you should be taken to its latest version.

Modified: trunk/projects/semantics/vocabularies/convert.py
==============================================================================
--- trunk/projects/semantics/vocabularies/convert.py	Tue Dec 11 11:57:20 2018	(r5263)
+++ trunk/projects/semantics/vocabularies/convert.py	Tue Dec 11 14:50:11 2018	(r5264)
@@ -48,6 +48,7 @@
 import subprocess
 import textwrap
 import sys
+import urlparse
 
 
 MANDATORY_KEYS = frozenset([
@@ -350,6 +351,7 @@
             " {} missing.".format(vocab_path, ", ".join(missing_keys)))
 
     vocab_def["baseuri"] = root_uri+vocab_path
+    vocab_def["vocab_path"] = vocab_path
     vocab_def["name"] = vocab_path.split("/")[-1]
     vocab_def["terms_fname"] = os.path.join(vocab_path, "terms.csv")
 
@@ -476,9 +478,10 @@
 
     This must be called one level up from the ttl and html files.
     """
+    install_base = urlparse.urlparse(vocab_def["baseuri"]).path+"/"
     with open(".htaccess", "w") as f:
         f.write(HT_ACCESS_TEMPLATE.format(
-            install_base=vocab_def["baseuri"]+"/",
+            install_base=install_base,
             timestamp=vocab_def["timestamp"],
             name=vocab_def["name"]))
 
@@ -551,12 +554,15 @@
         raise
 
     with work_dir(
-            os.path.join(dest_root, vocab_def["name"], vocab_def["timestamp"])):
+            os.path.join(
+                dest_root, 
+                vocab_def["vocab_path"], 
+                vocab_def["timestamp"])):
         write_ontology(vocab_def, terms)
         write_html(vocab_def, terms)
 
     with work_dir(
-            os.path.join(dest_root, vocab_def["name"])):
+            os.path.join(dest_root, vocab_def["vocab_path"])):
         write_htaccess(vocab_def, terms)
         write_meta_inf(vocab_def)
 
@@ -577,7 +583,7 @@
         default="http://www.ivoa.net/rdf/",
         metavar="URI")
     parser.add_argument("--dest-dir",
-        help="Write HTML and RDF output files to PATH.",
+        help="Write HTML and RDF output files to PATH (default: build).",
         action="store",
         dest="dest_dir",
         default="build",

Added: trunk/projects/semantics/vocabularies/vocabs.conf
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/projects/semantics/vocabularies/vocabs.conf	Tue Dec 11 14:50:11 2018	(r5264)
@@ -0,0 +1,34 @@
+[voresource/content_level]
+timestamp: 2016-08-17
+title: Content levels for VO resources
+description: This vocabulary enumerates the intended audiences
+	for resources in the Virtual Observatory.  It is designed to
+	enable discovery queries like "only research-level data" or
+	"resources usable in school settings".
+authors: Plante, R.; Demleitner, M.
+
+[voresource/content_type]
+timestamp: 2016-08-17
+title: Content types of VO resources
+description: This vocabulary enumerates types of resources in the Virtual 
+	Observatory in a very general manner.  Most actual services will
+	be one of Archive, Catalog, or Survey.
+authors: Plante, R.; Demleitner, M.
+
+[voresource/date_role]
+timestamp: 2016-08-17
+title: Roles of dates
+description: This vocabulary enumerates roles of dates in the development
+	of VO resources.  Most of these terms are taken from the dateType
+	enumeration in the DataCite metadata kernel.
+authors: Plante, R.; Demleitner, M.
+
+[voresource/relationship_type]
+timestamp: 2016-08-17
+title: Relationship types in the VO
+description: This vocabulary enumerates the kinds of relationships
+	between VO resources that can be relevant in discovery or maintenance.
+	Many of the terms are taken from the relationType enumeration in
+	the DataCite metadata kernel.  Operationally important concepts
+	missing there (e.g., served-by) were drawn from VOResource 1.0.
+authors: Plante, R.; Demleitner, M.


More information about the Volutecommits mailing list