소스 검색

Remove unused namespaces and old branding remnants.

scossu 1 주 전
부모
커밋
473c4c48de
4개의 변경된 파일17개의 추가작업 그리고 16개의 파일을 삭제
  1. 1 1
      ext/hashmap
  2. 1 1
      include/volksdata/core.h
  3. 1 4
      include/volksdata/data/bootstrap.h
  4. 14 10
      test/test_namespace.c

+ 1 - 1
ext/hashmap

@@ -1 +1 @@
-Subproject commit 0f66b4653fd215103db08f546a296cf1cb0dd82f
+Subproject commit 5e475b4662622c51b8f375e7b2013e25f3c77b57

+ 1 - 1
include/volksdata/core.h

@@ -53,7 +53,7 @@
  * @ingroup public
  * @{
  */
-#define VOLK_NS "urn:lsup:"             /// Default LS namespace.
+#define VOLK_NS "info:volksdata:"      /// Default VOLK namespace.
 
 #define KLEN sizeof(VOLK_Key)           /// Key length.
 #define DBL_KLEN sizeof(VOLK_DoubleKey) /// Double key length.

+ 1 - 4
include/volksdata/data/bootstrap.h

@@ -4,12 +4,9 @@
 /** @brief Initial namespace map.
  */
 const char *init_nsmap[][2] = {
-    {"dc",       "http://purl.org/dc/elements/1.1/"},
-    {"dcterms",  "http://purl.org/dc/terms/"},
-    {"foaf",     "http://xmlns.com/foaf/0.1/"},
-    {"lsup",     VOLK_NS},
     {"rdf",      "http://www.w3.org/1999/02/22-rdf-syntax-ns#"},
     {"rdfs",     "http://www.w3.org/2000/01/rdf-schema#"},
+    {"volk",     VOLK_NS},
     {"xsd",      "http://www.w3.org/2001/XMLSchema#"},
     {NULL}
 };

+ 14 - 10
test/test_namespace.c

@@ -9,26 +9,30 @@ test_namespace()
 
     ASSERT (VOLK_default_nsm != NULL, "Error creating namespace map on init!");
 
-    EXPECT_PASS (
-            VOLK_nsmap_add ("tdc", "http://purl.org/dc/elements/1.1/"));
-    EXPECT_PASS (VOLK_nsmap_add ("tdcterms", "http://purl.org/dc/terms/"));
+    EXPECT_PASS (VOLK_nsmap_add (
+                "rdfxx", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+    EXPECT_PASS (VOLK_nsmap_add (
+                "rdfsxxx", "http://www.w3.org/2000/01/rdf-schema#"));
     EXPECT_PASS (VOLK_nsmap_add ("ns1", "urn:ns1:"));
     EXPECT_PASS (VOLK_nsmap_add ("ns2", "urn:ns2:"));
 
     // Look up prefix.
     EXPECT_STR_EQ (
-            VOLK_nsmap_get_ns ("tdc"), "http://purl.org/dc/elements/1.1/");
+            VOLK_nsmap_get_ns ("rdfxx"),
+            "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
     EXPECT_STR_EQ (
-            VOLK_nsmap_get_ns ("tdcterms"), "http://purl.org/dc/terms/");
+            VOLK_nsmap_get_ns ("rdfsxxx"),
+            "http://www.w3.org/2000/01/rdf-schema#");
     // Prefixes longer than 7 chars are truncated.
     EXPECT_STR_EQ (
-            VOLK_nsmap_get_ns ("dctermsxx"), "http://purl.org/dc/terms/");
+            VOLK_nsmap_get_ns ("rdfsxxxyyy"),
+            "http://www.w3.org/2000/01/rdf-schema#");
     ASSERT (VOLK_nsmap_get_ns ("none") == NULL, "Non-existent NS found!");
 
     // Lookup NS.
     EXPECT_STR_EQ (VOLK_nsmap_get_pfx ("urn:ns1:"), "ns1");
     EXPECT_STR_EQ (VOLK_nsmap_get_pfx ("urn:ns2:"), "ns2");
-    // Cannot test tdc and tdcterms reverse lookup because dc and dcterms are
+    // Cannot test rdfxx and rdfsxxx reverse lookup because dc and dcterms are
     // also mapped to the same ns, and either one can come up.
 
     // Normalize and denormalize URIs.
@@ -62,8 +66,8 @@ test_namespace()
     ASSERT (!fq_uri, "Faulty normalization output should be NULL!");
     free (fq_uri);
 
-    EXPECT_PASS (VOLK_nsmap_remove ("tdc"));
-    ASSERT (VOLK_nsmap_get_ns ("tdc") == NULL, "Deleted NS found!");
+    EXPECT_PASS (VOLK_nsmap_remove ("rdfxx"));
+    ASSERT (VOLK_nsmap_get_ns ("rdfxx") == NULL, "Deleted NS found!");
 
     ASSERT (
             VOLK_nsmap_remove ("none") == VOLK_NOACTION,
@@ -71,7 +75,7 @@ test_namespace()
 
     // Test normalization after removal.
     ASSERT (
-            VOLK_nsmap_normalize_uri ("tdc:title", &fq_uri)
+            VOLK_nsmap_normalize_uri ("rdfxx:title", &fq_uri)
             == VOLK_NORESULT, "Wrong RC for normalizing non-prefixed URI!");
     ASSERT (!fq_uri, "Faulty normalization output should be NULL!");
     free (fq_uri);