From ffbfce53cbf43372f5f446bfa4f58c8239e74549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Tore=20L=C3=B8vfall?= Date: Tue, 6 Jul 2021 12:02:05 +0200 Subject: [PATCH 1/5] Changed name space from meta.sintef.no to onto-ns.com This branch does to compile at this time --- README.md | 6 +++--- bindings/fortran/tests/Animal.json | 4 ++-- bindings/fortran/tests/Person.json | 6 +++--- bindings/fortran/tests/Scan3D.json | 4 ++-- bindings/fortran/tests/inputs.json | 4 ++-- bindings/fortran/tests/persons.json | 4 ++-- bindings/fortran/tests/persons_names.json | 6 +++--- bindings/python/dlite-entity.i | 6 +++--- bindings/python/tests/MyEntity.json | 6 +++--- bindings/python/tests/Person.json | 6 +++--- bindings/python/tests/SimplePerson.json | 4 ++-- bindings/python/tests/python-mapping-plugins/plugin1.py | 8 ++++---- bindings/python/tests/test_entity.py | 8 ++++---- bindings/python/tests/test_mapping.py | 6 +++--- bindings/python/tests/test_storage.py | 4 ++-- examples/ex1/Chemistry-0.1.json | 2 +- examples/ex2/Chemistry-0.1.json | 2 +- examples/ex3/PhilibTable.json | 6 +++--- examples/ex3/example-AlMgSi.json | 2 +- examples/ex3/main.c | 2 +- examples/ex4/Chemistry-0.1.json | 2 +- examples/ex4/example-AlMgSi.json | 2 +- examples/ex5d/Plot PhilibTable.ipynb | 2 +- examples/ex5d/example5d.c | 2 +- examples/ex5d/philibtable.h | 8 ++++---- examples/storages/Chemistry-0.1.json | 2 +- examples/storages/Person.json | 6 +++--- examples/storages/persons.json | 2 +- examples/storages/persons2.json | 2 +- src/dlite-schemas.c | 6 +++--- src/dlite-schemas.h | 6 +++--- src/tests/mappings/ent1.json | 2 +- src/tests/mappings/ent2.json | 2 +- src/tests/mappings/ent3.json | 4 ++-- src/tests/mappings/instances.json | 2 +- src/tests/mappings/mapA.c | 6 +++--- src/tests/python/plugin1.py | 8 ++++---- src/tests/python/test_pyembed.c | 4 ++-- src/tests/python/test_python_mapping.c | 2 +- src/tests/test-data.json | 4 ++-- src/tests/test-entity.json | 6 +++--- src/tests/test_mapping.c | 8 ++++---- src/tests/test_metamodel.c | 4 ++-- src/tests/test_storage_lookup.c | 2 +- storages/python/python-storage-plugins/blob.py | 4 ++-- storages/python/tests/Person.json | 6 +++--- storages/python/tests/test_postgresql_storage2.c | 2 +- storages/rdf/tests/data.xml | 8 ++++---- tools/dlite-codegen.c | 1 + tools/templates/fortran-module.txt | 2 +- tools/tests/Chemistry-0.1.json | 6 +++--- 51 files changed, 110 insertions(+), 109 deletions(-) diff --git a/README.md b/README.md index 55457a002..111e1b4a0 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,8 @@ and its properties provide in the "description" fields. { "name": "Person", "version": "0.1", - "namespace": "http://meta.sintef.no", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "A person.", "dimensions": [ { @@ -225,7 +225,7 @@ The following terms have a special meaning in dlite: - **Entity**: May be any kind of instance, including data instances, metadata instances or meta-metadata instances. However, for historical reasons it is often used for "standard" metadata that are instances of - meta-metadata "http://meta.sintef.no/0.3/EntitySchema". + meta-metadata "http://onto-ns.com/meta/0.3/EntitySchema". - **Instance**: The basic data object in DLite. All instances are described by their metadata which itself are instances. Instances are identified by an UUID. diff --git a/bindings/fortran/tests/Animal.json b/bindings/fortran/tests/Animal.json index be664ba67..cbc4972ae 100644 --- a/bindings/fortran/tests/Animal.json +++ b/bindings/fortran/tests/Animal.json @@ -1,8 +1,8 @@ { "name": "Animal", "version": "0.1", - "namespace": "http://meta.sintef.no", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Define a metadata without dimension.", "dimensions": [ ], diff --git a/bindings/fortran/tests/Person.json b/bindings/fortran/tests/Person.json index 516cba047..6e54782f8 100644 --- a/bindings/fortran/tests/Person.json +++ b/bindings/fortran/tests/Person.json @@ -1,8 +1,8 @@ { "name": "Person", "version": "0.2", - "namespace": "http://meta.sintef.no", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "A person.", "dimensions": [ { @@ -44,5 +44,5 @@ "description": "Temperature on the body." } ], - "dataname": "http://meta.sintef.no/0.2/Person" + "dataname": "http://onto-ns.com/meta/0.2/Person" } diff --git a/bindings/fortran/tests/Scan3D.json b/bindings/fortran/tests/Scan3D.json index 6606ca01d..04e82aed4 100644 --- a/bindings/fortran/tests/Scan3D.json +++ b/bindings/fortran/tests/Scan3D.json @@ -1,8 +1,8 @@ { "name": "Scan3D", "version": "0.1", - "namespace": "http://meta.sintef.no", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "A 3D scan.", "dimensions": [ { diff --git a/bindings/fortran/tests/inputs.json b/bindings/fortran/tests/inputs.json index 197ef4594..e2db7a5d8 100644 --- a/bindings/fortran/tests/inputs.json +++ b/bindings/fortran/tests/inputs.json @@ -1,6 +1,6 @@ { "b04965e6-a9bb-591f-8f8a-1adcb2c8dc39": { - "meta": "http://meta.sintef.no/0.2/Person", + "meta": "http://onto-ns.com/meta/0.2/Person", "dimensions": { "N": 2, "M": 3 @@ -13,7 +13,7 @@ } }, "4b166dbe-d99d-5091-abdd-95b83330ed3a": { - "meta": "http://meta.sintef.no/0.1/Scan3D", + "meta": "http://onto-ns.com/meta/0.1/Scan3D", "dimensions": { "N": 3, "P": 5 diff --git a/bindings/fortran/tests/persons.json b/bindings/fortran/tests/persons.json index 4f45d2449..59cd64b20 100644 --- a/bindings/fortran/tests/persons.json +++ b/bindings/fortran/tests/persons.json @@ -1,6 +1,6 @@ { "d473aa6f-2da3-4889-a88d-0c96186c3fa2": { - "meta": "http://meta.sintef.no/0.2/Person", + "meta": "http://onto-ns.com/meta/0.2/Person", "dimensions": { "N": 2, "M": 3 @@ -13,7 +13,7 @@ } }, "ccdcb6a5-b730-4fd4-a98b-3cd8470c928b": { - "meta": "http://meta.sintef.no/0.2/Person", + "meta": "http://onto-ns.com/meta/0.2/Person", "dimensions": { "N": 3, "M": 1 diff --git a/bindings/fortran/tests/persons_names.json b/bindings/fortran/tests/persons_names.json index fa0895d71..364e2d474 100644 --- a/bindings/fortran/tests/persons_names.json +++ b/bindings/fortran/tests/persons_names.json @@ -1,6 +1,6 @@ { "Joe": { - "meta": "http://meta.sintef.no/0.2/Person", + "meta": "http://onto-ns.com/meta/0.2/Person", "dimensions": { "N": 2, "M": 3 @@ -13,7 +13,7 @@ } }, "Elisa": { - "meta": "http://meta.sintef.no/0.2/Person", + "meta": "http://onto-ns.com/meta/0.2/Person", "dimensions": { "N": 3, "M": 1 @@ -26,7 +26,7 @@ } }, "Joe Doe": { - "meta": "http://meta.sintef.no/0.2/Person", + "meta": "http://onto-ns.com/meta/0.2/Person", "name": "Joe Doe", "age": 53.0, "skills": ["java", "c#", "c++"], diff --git a/bindings/python/dlite-entity.i b/bindings/python/dlite-entity.i index 3e0c90533..bba4b5c21 100644 --- a/bindings/python/dlite-entity.i +++ b/bindings/python/dlite-entity.i @@ -502,9 +502,9 @@ void dlite_swig_set_property(struct _DLiteInstance *inst, const char *name, bool dlite_instance_has_property(struct _DLiteInstance *inst, const char *name); /* FIXME - how do we avoid duplicating these constants from dlite-schemas.h? */ -#define BASIC_METADATA_SCHEMA "http://meta.sintef.no/0.1/BasicMetadataSchema" -#define ENTITY_SCHEMA "http://meta.sintef.no/0.3/EntitySchema" -#define COLLECTION_ENTITY "http://meta.sintef.no/0.1/Collection" +#define BASIC_METADATA_SCHEMA "http://onto-ns.com/meta/0.1/BasicMetadataSchema" +#define ENTITY_SCHEMA "http://onto-ns.com/meta/0.3/EntitySchema" +#define COLLECTION_ENTITY "http://onto-ns.com/meta/0.1/Collection" /* ----------------------------------- * Target language-spesific extensions diff --git a/bindings/python/tests/MyEntity.json b/bindings/python/tests/MyEntity.json index 4d0e909a9..406ad4327 100644 --- a/bindings/python/tests/MyEntity.json +++ b/bindings/python/tests/MyEntity.json @@ -1,8 +1,8 @@ { "name": "MyEntity", "version": "0.1", - "namespace": "http://meta.sintef.no", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Just some tests..", "dimensions": [ { @@ -112,5 +112,5 @@ "description": "A relation array" } ], - "dataname": "http://meta.sintef.no/0.1/MyEntity" + "dataname": "http://onto-ns.com/meta/0.1/MyEntity" } \ No newline at end of file diff --git a/bindings/python/tests/Person.json b/bindings/python/tests/Person.json index 58ed83990..329d13508 100644 --- a/bindings/python/tests/Person.json +++ b/bindings/python/tests/Person.json @@ -1,8 +1,8 @@ { "name": "Person", "version": "0.1", - "namespace": "http://meta.sintef.no", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "A person.", "dimensions": [ { @@ -31,5 +31,5 @@ "description": "List of skills." } ], - "dataname": "http://meta.sintef.no/0.1/Person" + "dataname": "http://onto-ns.com/meta/0.1/Person" } \ No newline at end of file diff --git a/bindings/python/tests/SimplePerson.json b/bindings/python/tests/SimplePerson.json index 53f3c0b35..2ee1b1b91 100644 --- a/bindings/python/tests/SimplePerson.json +++ b/bindings/python/tests/SimplePerson.json @@ -1,8 +1,8 @@ { "name": "SimplePerson", "version": "0.1", - "namespace": "http://meta.sintef.no", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "A simple person representation.", "dimensions": [], "properties": [ diff --git a/bindings/python/tests/python-mapping-plugins/plugin1.py b/bindings/python/tests/python-mapping-plugins/plugin1.py index 60c9e3cc4..19c566c26 100644 --- a/bindings/python/tests/python-mapping-plugins/plugin1.py +++ b/bindings/python/tests/python-mapping-plugins/plugin1.py @@ -3,8 +3,8 @@ class Person2SimplePerson(DLiteMappingBase): name = "Person2SimplePerson" - output_uri = "http://meta.sintef.no/0.1/SimplePerson" - input_uris = ["http://meta.sintef.no/0.1/Person"] + output_uri = "http://onto-ns.com/meta/0.1/SimplePerson" + input_uris = ["http://onto-ns.com/meta/0.1/Person"] cost = 25 def map(self, instances): @@ -17,8 +17,8 @@ def map(self, instances): class SimplePerson2Person(DLiteMappingBase): name = "SimplePerson2Person" - output_uri = "http://meta.sintef.no/0.1/Person" - input_uris = ["http://meta.sintef.no/0.1/SimplePerson"] + output_uri = "http://onto-ns.com/meta/0.1/Person" + input_uris = ["http://onto-ns.com/meta/0.1/SimplePerson"] cost = 25 def map(self, instances): diff --git a/bindings/python/tests/test_entity.py b/bindings/python/tests/test_entity.py index 6fd446d3c..25c2f6d91 100755 --- a/bindings/python/tests/test_entity.py +++ b/bindings/python/tests/test_entity.py @@ -17,7 +17,7 @@ # Check some properties of the entity assert myentity.uuid == 'ea34bc5e-de88-544d-bcba-150b7292873d' -assert myentity.uri == 'http://meta.sintef.no/0.1/MyEntity' +assert myentity.uri == 'http://onto-ns.com/meta/0.1/MyEntity' assert myentity.dimensions == {'ndimensions': 2, 'nproperties': 14} assert not myentity.is_data assert myentity.is_meta @@ -85,12 +85,12 @@ assert inst.meta == myentity -e = dlite.get_instance('http://meta.sintef.no/0.1/MyEntity') +e = dlite.get_instance('http://onto-ns.com/meta/0.1/MyEntity') assert e == myentity assert e != inst e2 = Instance( - 'http://meta.sintef.no/0.1/NewEntity', + 'http://onto-ns.com/meta/0.1/NewEntity', [Dimension('N', 'Number of something')], [Property('name', type='string', description='Name of something.'), Property('arr', type='int', dims=['N+2'], description='An array.'), @@ -98,7 +98,7 @@ 'Something new...') e3 = Instance( - 'http://meta.sintef.no/0.1/NewEntity2', + 'http://onto-ns.com/meta/0.1/NewEntity2', [], [Property('name', type='string', description='Name of something.'), Property('arr', type='int', description='An array.'), diff --git a/bindings/python/tests/test_mapping.py b/bindings/python/tests/test_mapping.py index f6fc95573..801cf44ad 100644 --- a/bindings/python/tests/test_mapping.py +++ b/bindings/python/tests/test_mapping.py @@ -17,7 +17,7 @@ person.skills = ['keping the head cold', 'famous quotes'] # Map person to an instance of SimplePerson -simple = dlite.mapping('http://meta.sintef.no/0.1/SimplePerson', [person]) +simple = dlite.mapping('http://onto-ns.com/meta/0.1/SimplePerson', [person]) assert simple != person assert simple.name == person.name assert simple.age == person.age @@ -28,7 +28,7 @@ # Get the added person instance from the collection mapped to a new # instance of SimplePerson (the second argument can be omitted...) -s = coll.get('simple', 'http://meta.sintef.no/0.1/SimplePerson') +s = coll.get('simple', 'http://onto-ns.com/meta/0.1/SimplePerson') assert s == simple s2 = coll.get('simple') assert s2 == s @@ -36,7 +36,7 @@ # Get the added person instance from the collection mapped to a new # instance of Person (with no skills) -p = coll.get('simple', 'http://meta.sintef.no/0.1/Person') +p = coll.get('simple', 'http://onto-ns.com/meta/0.1/Person') assert p != person assert p.meta == person.meta assert p.name == person.name diff --git a/bindings/python/tests/test_storage.py b/bindings/python/tests/test_storage.py index ddccdbe80..5bee105ca 100755 --- a/bindings/python/tests/test_storage.py +++ b/bindings/python/tests/test_storage.py @@ -11,8 +11,8 @@ # Load metadata (i.e. an instance of meta-metadata) from url s = dlite.Storage(url) -myentity = dlite.Instance(s, 'http://meta.sintef.no/0.1/MyEntity') +myentity = dlite.Instance(s, 'http://onto-ns.com/meta/0.1/MyEntity') del s with dlite.Storage(url) as s2: - myentity2 = dlite.Instance(s2, 'http://meta.sintef.no/0.1/MyEntity') + myentity2 = dlite.Instance(s2, 'http://onto-ns.com/meta/0.1/MyEntity') diff --git a/examples/ex1/Chemistry-0.1.json b/examples/ex1/Chemistry-0.1.json index f2e59d2e7..16b4832f0 100644 --- a/examples/ex1/Chemistry-0.1.json +++ b/examples/ex1/Chemistry-0.1.json @@ -2,7 +2,7 @@ "name": "Chemistry", "version": "0.1", "namespace": "http://www.sintef.no/calm", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Simple entity with alloy and particle compositions.", "dimensions": [ { diff --git a/examples/ex2/Chemistry-0.1.json b/examples/ex2/Chemistry-0.1.json index f2e59d2e7..16b4832f0 100644 --- a/examples/ex2/Chemistry-0.1.json +++ b/examples/ex2/Chemistry-0.1.json @@ -2,7 +2,7 @@ "name": "Chemistry", "version": "0.1", "namespace": "http://www.sintef.no/calm", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Simple entity with alloy and particle compositions.", "dimensions": [ { diff --git a/examples/ex3/PhilibTable.json b/examples/ex3/PhilibTable.json index ba901f1c6..5dc1476ef 100644 --- a/examples/ex3/PhilibTable.json +++ b/examples/ex3/PhilibTable.json @@ -1,8 +1,8 @@ { "name": "PhilibTable", "version": "0.1", - "namespace": "http://meta.sintef.no/philib", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta/philib", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Tabulation of thermodynamic phase diagramata for philib.", "dimensions": [ { @@ -137,5 +137,5 @@ "description": "The values of the free variables for which the calculated variables are calculated." } ], - "dataname": "http://meta.sintef.no/philib/0.1/PhilibTable" + "dataname": "http://onto-ns.com/meta/philib/0.1/PhilibTable" } \ No newline at end of file diff --git a/examples/ex3/example-AlMgSi.json b/examples/ex3/example-AlMgSi.json index 92b21c907..d84e86256 100644 --- a/examples/ex3/example-AlMgSi.json +++ b/examples/ex3/example-AlMgSi.json @@ -3,7 +3,7 @@ "meta": { "name": "PhilibTable", "version": "0.1", - "namespace": "http://meta.sintef.no/philib" + "namespace": "http://onto-ns.com/meta/philib" }, "dimensions": { "nelements": 3, diff --git a/examples/ex3/main.c b/examples/ex3/main.c index 062e88b06..f912dd820 100644 --- a/examples/ex3/main.c +++ b/examples/ex3/main.c @@ -90,7 +90,7 @@ int main() /* Load PhilibTable entity */ s = dlite_storage_open("json", path, "mode=r"); - char *uri = "http://meta.sintef.no/philib/0.1/PhilibTable"; + char *uri = "http://onto-ns.com/meta/philib/0.1/PhilibTable"; table = (DLiteMeta *)dlite_meta_load(s, uri); dlite_storage_close(s); diff --git a/examples/ex4/Chemistry-0.1.json b/examples/ex4/Chemistry-0.1.json index f2e59d2e7..16b4832f0 100644 --- a/examples/ex4/Chemistry-0.1.json +++ b/examples/ex4/Chemistry-0.1.json @@ -2,7 +2,7 @@ "name": "Chemistry", "version": "0.1", "namespace": "http://www.sintef.no/calm", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Simple entity with alloy and particle compositions.", "dimensions": [ { diff --git a/examples/ex4/example-AlMgSi.json b/examples/ex4/example-AlMgSi.json index 92b21c907..d84e86256 100644 --- a/examples/ex4/example-AlMgSi.json +++ b/examples/ex4/example-AlMgSi.json @@ -3,7 +3,7 @@ "meta": { "name": "PhilibTable", "version": "0.1", - "namespace": "http://meta.sintef.no/philib" + "namespace": "http://onto-ns.com/meta/philib" }, "dimensions": { "nelements": 3, diff --git a/examples/ex5d/Plot PhilibTable.ipynb b/examples/ex5d/Plot PhilibTable.ipynb index e29e61b01..5749e3a12 100644 --- a/examples/ex5d/Plot PhilibTable.ipynb +++ b/examples/ex5d/Plot PhilibTable.ipynb @@ -42,7 +42,7 @@ " 'npoints': 2000,\n", " 'nvars': 2},\n", " 'meta': {'name': 'PhilibTable',\n", - " 'namespace': 'http://meta.sintef.no/philib',\n", + " 'namespace': 'http://onto-ns.com/meta/philib',\n", " 'version': '0.1'},\n", " 'properties': {'calcnames': ['fv(FCC_A1)',\n", " 'X(FCC_A1,Si)',\n", diff --git a/examples/ex5d/example5d.c b/examples/ex5d/example5d.c index 0fa2551e8..407fea186 100644 --- a/examples/ex5d/example5d.c +++ b/examples/ex5d/example5d.c @@ -111,7 +111,7 @@ main(int argc, char *argv) /* Load PhilibTable entity */ s = dlite_storage_open("json", path, "mode=r"); - char *uri = "http://meta.sintef.no/philib/0.1/PhilibTable"; + char *uri = "http://onto-ns.com/meta/philib/0.1/PhilibTable"; table = (DLiteMeta *)dlite_meta_load(s, uri); size_t ndims = table->ndimensions; dlite_storage_close(s); diff --git a/examples/ex5d/philibtable.h b/examples/ex5d/philibtable.h index 8454cd3aa..9d59dd0de 100644 --- a/examples/ex5d/philibtable.h +++ b/examples/ex5d/philibtable.h @@ -1,7 +1,7 @@ /* This file is generated with dlite-codegen -- do not edit! * * Template: c-header.txt - * Metadata: http://meta.sintef.no/philib/0.1/PhilibTable + * Metadata: http://onto-ns.com/meta/philib/0.1/PhilibTable * * This file declares a struct for metadata PhilibTable that can be included * and used in your project without any dependencies (except for the @@ -22,10 +22,10 @@ #define PHILIBTABLE_NAME "PhilibTable" #define PHILIBTABLE_VERSION "0.1" -#define PHILIBTABLE_NAMESPACE "http://meta.sintef.no/philib" -#define PHILIBTABLE_URI "http://meta.sintef.no/philib/0.1/PhilibTable" +#define PHILIBTABLE_NAMESPACE "http://onto-ns.com/meta/philib" +#define PHILIBTABLE_URI "http://onto-ns.com/meta/philib/0.1/PhilibTable" #define PHILIBTABLE_UUID "f6626c3e-e427-59b9-b5fd-0c296bd5787d" -#define PHILIBTABLE_META_URI "http://meta.sintef.no/0.3/EntitySchema" +#define PHILIBTABLE_META_URI "http://onto-ns.com/meta/0.3/EntitySchema" #define PHILIBTABLE_META_UUID "57742a73-ba65-5797-aebf-c1a270c4d02b" diff --git a/examples/storages/Chemistry-0.1.json b/examples/storages/Chemistry-0.1.json index c9a59ffd0..c8dd6cfaa 100644 --- a/examples/storages/Chemistry-0.1.json +++ b/examples/storages/Chemistry-0.1.json @@ -2,7 +2,7 @@ "name": "Chemistry", "version": "0.1", "namespace": "http://www.sintef.no/calm", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Simple entity with alloy and particle compositions.", "dimensions": [ { diff --git a/examples/storages/Person.json b/examples/storages/Person.json index 58ed83990..329d13508 100644 --- a/examples/storages/Person.json +++ b/examples/storages/Person.json @@ -1,8 +1,8 @@ { "name": "Person", "version": "0.1", - "namespace": "http://meta.sintef.no", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "A person.", "dimensions": [ { @@ -31,5 +31,5 @@ "description": "List of skills." } ], - "dataname": "http://meta.sintef.no/0.1/Person" + "dataname": "http://onto-ns.com/meta/0.1/Person" } \ No newline at end of file diff --git a/examples/storages/persons.json b/examples/storages/persons.json index 617185f70..54dd59b3a 100644 --- a/examples/storages/persons.json +++ b/examples/storages/persons.json @@ -3,7 +3,7 @@ "meta": { "name": "Person", "version": "0.1", - "namespace": "http://meta.sintef.no" + "namespace": "http://onto-ns.com/meta" }, "dimensions": { "N": 2 diff --git a/examples/storages/persons2.json b/examples/storages/persons2.json index 617185f70..54dd59b3a 100644 --- a/examples/storages/persons2.json +++ b/examples/storages/persons2.json @@ -3,7 +3,7 @@ "meta": { "name": "Person", "version": "0.1", - "namespace": "http://meta.sintef.no" + "namespace": "http://onto-ns.com/meta" }, "dimensions": { "N": 2 diff --git a/src/dlite-schemas.c b/src/dlite-schemas.c index af0bd91f9..0e13432b9 100644 --- a/src/dlite-schemas.c +++ b/src/dlite-schemas.c @@ -151,7 +151,7 @@ static struct _BasicMetadataSchema { /* -- value of each property */ "BasicMetadataSchema", /* name */ "0.1", /* version */ - "http://meta.sintef.no", /* namespace */ + "http://onto-ns.com/meta", /* namespace */ "Meta-metadata description an entity.", /* description */ basic_metadata_schema_dimensions, /* dimensions */ basic_metadata_schema_properties, /* properties */ @@ -307,7 +307,7 @@ static struct _EntitySchema { /* -- value of each property */ "EntitySchema", /* name */ "0.3", /* version */ - "http://meta.sintef.no", /* namespace */ + "http://onto-ns.com/meta", /* namespace */ "Meta-metadata description an entity.", /* description */ entity_schema_dimensions, /* dimensions */ entity_schema_properties, /* properties */ @@ -404,7 +404,7 @@ static struct _CollectionEntity { /* -- value of each property */ "Collection", /* name */ "0.1", /* version */ - "http://meta.sintef.no", /* namespace */ + "http://onto-ns.com/meta", /* namespace */ "Meta-metadata description a collection.", /* description */ collection_entity_dimensions, /* dimensions */ collection_entity_properties, /* properties */ diff --git a/src/dlite-schemas.h b/src/dlite-schemas.h index 35957fdf2..ced652410 100644 --- a/src/dlite-schemas.h +++ b/src/dlite-schemas.h @@ -11,13 +11,13 @@ /** URIs for hardcoded metadata */ #define DLITE_BASIC_METADATA_SCHEMA \ - "http://meta.sintef.no/0.1/BasicMetadataSchema" + "http://onto-ns.com/meta/0.1/BasicMetadataSchema" #define DLITE_ENTITY_SCHEMA \ - "http://meta.sintef.no/0.3/EntitySchema" + "http://onto-ns.com/meta/0.3/EntitySchema" #define DLITE_COLLECTION_ENTITY \ - "http://meta.sintef.no/0.1/Collection" + "http://onto-ns.com/meta/0.1/Collection" /** Functions returning a pointer to static definitions of basic schemas. */ diff --git a/src/tests/mappings/ent1.json b/src/tests/mappings/ent1.json index 3ecc57259..0569fdb9c 100644 --- a/src/tests/mappings/ent1.json +++ b/src/tests/mappings/ent1.json @@ -1,7 +1,7 @@ { "name": "ent1", "version": "0.1", - "namespace": "http://meta.sintef.no", + "namespace": "http://onto-ns.com/meta", "description": "test entity", "dimensions": [], "properties": [ diff --git a/src/tests/mappings/ent2.json b/src/tests/mappings/ent2.json index 6cec06183..2526539f6 100644 --- a/src/tests/mappings/ent2.json +++ b/src/tests/mappings/ent2.json @@ -1,7 +1,7 @@ { "name": "ent2", "version": "0.1", - "namespace": "http://meta.sintef.no", + "namespace": "http://onto-ns.com/meta", "description": "test entity", "dimensions": [], "properties": [ diff --git a/src/tests/mappings/ent3.json b/src/tests/mappings/ent3.json index 06e9cac28..48ea31cb8 100644 --- a/src/tests/mappings/ent3.json +++ b/src/tests/mappings/ent3.json @@ -1,7 +1,7 @@ { "name": "ent3", "version": "0.1", - "namespace": "http://meta.sintef.no", + "namespace": "http://onto-ns.com/meta", "description": "test entity", "dimensions": [], "properties": [ @@ -11,5 +11,5 @@ "unit": "hundreds" } ], - "dataname": "http://meta.sintef.no/0.1/ent1" + "dataname": "http://onto-ns.com/meta/0.1/ent1" } \ No newline at end of file diff --git a/src/tests/mappings/instances.json b/src/tests/mappings/instances.json index 163dc605c..a928908b1 100644 --- a/src/tests/mappings/instances.json +++ b/src/tests/mappings/instances.json @@ -1,6 +1,6 @@ { "2daa6967-8ecd-4248-97b2-9ad6fefeac14": { - "meta": "http://meta.sintef.no/0.1/ent1", + "meta": "http://onto-ns.com/meta/0.1/ent1", "dimensions": {}, "properties": { "a": 42 diff --git a/src/tests/mappings/mapA.c b/src/tests/mappings/mapA.c index c6dd6482e..14db25f74 100644 --- a/src/tests/mappings/mapA.c +++ b/src/tests/mappings/mapA.c @@ -23,7 +23,7 @@ DLiteInstance *mapper(const DLiteMappingPlugin *api, inst1 = instances[0]; - if (!(inst2 = dlite_instance_create_from_id("http://meta.sintef.no/0.1/ent2", + if (!(inst2 = dlite_instance_create_from_id("http://onto-ns.com/meta/0.1/ent2", NULL, NULL))) return NULL; p = dlite_instance_get_property(inst1, "a"); @@ -39,11 +39,11 @@ DLiteInstance *mapper(const DLiteMappingPlugin *api, DSL_EXPORT const DLiteMappingPlugin *get_dlite_mapping_api(int *iter) { static DLiteMappingPlugin api; - static const char *input_uris[] = { "http://meta.sintef.no/0.1/ent1" }; + static const char *input_uris[] = { "http://onto-ns.com/meta/0.1/ent1" }; UNUSED(iter); api.name = "mapA"; - api.output_uri = "http://meta.sintef.no/0.1/ent2"; + api.output_uri = "http://onto-ns.com/meta/0.1/ent2"; api.ninput = 1; api.input_uris = input_uris; api.mapper = mapper; diff --git a/src/tests/python/plugin1.py b/src/tests/python/plugin1.py index 36352a8a3..f20981585 100644 --- a/src/tests/python/plugin1.py +++ b/src/tests/python/plugin1.py @@ -9,8 +9,8 @@ class plugin1(DLiteMappingBase): name = "plugin1" - output_uri = "http://meta.sintef.no/0.1/ent3" - input_uris = ["http://meta.sintef.no/0.1/ent1"] + output_uri = "http://onto-ns.com/meta/0.1/ent3" + input_uris = ["http://onto-ns.com/meta/0.1/ent1"] cost = 25 def map(self, instances): @@ -22,8 +22,8 @@ def map(self, instances): class plugin2(DLiteMappingBase): name = "plugin2" - output_uri = "http://meta.sintef.no/0.1/ent1" - input_uris = ["http://meta.sintef.no/0.1/ent3"] + output_uri = "http://onto-ns.com/meta/0.1/ent1" + input_uris = ["http://onto-ns.com/meta/0.1/ent3"] cost = 25 def map(self, instances): diff --git a/src/tests/python/test_pyembed.c b/src/tests/python/test_pyembed.c index a994ab516..5043c503a 100644 --- a/src/tests/python/test_pyembed.c +++ b/src/tests/python/test_pyembed.c @@ -47,7 +47,7 @@ MU_TEST(test_get_address) { /* FIXME - enable this test on Windows */ #ifndef WINDOWS - const char *id = "http://meta.sintef.no/0.3/EntitySchema"; + const char *id = "http://onto-ns.com/meta/0.3/EntitySchema"; void *addr; fun_t fun; DLiteInstance *inst; @@ -76,7 +76,7 @@ MU_TEST(test_get_address) MU_TEST(test_get_instance) { - const char *id = "http://meta.sintef.no/0.3/EntitySchema"; + const char *id = "http://onto-ns.com/meta/0.3/EntitySchema"; PyObject *instance = dlite_pyembed_from_instance(id); mu_check(instance); printf("\nPython instance: "); diff --git a/src/tests/python/test_python_mapping.c b/src/tests/python/test_python_mapping.c index 3f5d41d1a..e2bc79df4 100644 --- a/src/tests/python/test_python_mapping.c +++ b/src/tests/python/test_python_mapping.c @@ -48,7 +48,7 @@ MU_TEST(test_map) instances[0] = dlite_instance_get("2daa6967-8ecd-4248-97b2-9ad6fefeac14"); mu_check(instances[0]); - inst3 = dlite_mapping("http://meta.sintef.no/0.1/ent3", instances, 1); + inst3 = dlite_mapping("http://onto-ns.com/meta/0.1/ent3", instances, 1); mu_check(inst3); mu_check((p = dlite_instance_get_property(inst3, "c"))); mu_assert_double_eq(54.0, (double)*((float *)p)); diff --git a/src/tests/test-data.json b/src/tests/test-data.json index 053b6861d..232f82b40 100644 --- a/src/tests/test-data.json +++ b/src/tests/test-data.json @@ -1,6 +1,6 @@ { "e076a856-e36e-5335-967e-2f2fd153c17d": { - "meta": "http://meta.sintef.no/0.1/test-entity", + "meta": "http://onto-ns.com/meta/0.1/test-entity", "dataname": "my_test_instance", "dimensions": { "L": 2, @@ -32,7 +32,7 @@ } }, "204b05b2-4c89-43f4-93db-fd1cb70f54ef": { - "meta": "http://meta.sintef.no/0.1/test-entity", + "meta": "http://onto-ns.com/meta/0.1/test-entity", "dimensions": { "L": 2, "M": 2, diff --git a/src/tests/test-entity.json b/src/tests/test-entity.json index c6848c4f8..188b669e6 100644 --- a/src/tests/test-entity.json +++ b/src/tests/test-entity.json @@ -1,8 +1,8 @@ { "name": "test-entity", "version": "0.1", - "namespace": "http://meta.sintef.no", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "test entity with explicit meta", "dimensions": [ { @@ -55,5 +55,5 @@ "description": "An array string pointer." } ], - "dataname": "http://meta.sintef.no/0.1/test-entity" + "dataname": "http://onto-ns.com/meta/0.1/test-entity" } \ No newline at end of file diff --git a/src/tests/test_mapping.c b/src/tests/test_mapping.c index 5a29e7e98..224ebf645 100644 --- a/src/tests/test_mapping.c +++ b/src/tests/test_mapping.c @@ -25,7 +25,7 @@ MU_TEST(test_create_from_id) { int b=-13, *p; DLiteInstance *inst; - inst = dlite_instance_create_from_id("http://meta.sintef.no/0.1/ent2", + inst = dlite_instance_create_from_id("http://onto-ns.com/meta/0.1/ent2", NULL, NULL); mu_check(inst); dlite_instance_set_property(inst, "b", &b); @@ -40,8 +40,8 @@ MU_TEST(test_mapping) DLiteInstance *inst, *inst2, *insts[1]; const DLiteInstance **instances = (const DLiteInstance **)insts; DLiteMapping *m; - const char *output_uri = "http://meta.sintef.no/0.1/ent2"; - const char *input_uris[] = { "http://meta.sintef.no/0.1/ent1" }; + const char *output_uri = "http://onto-ns.com/meta/0.1/ent2"; + const char *input_uris[] = { "http://onto-ns.com/meta/0.1/ent1" }; char *str; mu_check((inst = dlite_instance_get("2daa6967-8ecd-4248-97b2-9ad6fefeac14"))); @@ -68,7 +68,7 @@ MU_TEST(test_mapping) MU_TEST(test_get_casted) { DLiteInstance *inst; - const char *output_uri = "http://meta.sintef.no/0.1/ent2"; + const char *output_uri = "http://onto-ns.com/meta/0.1/ent2"; mu_check((inst = dlite_instance_get_casted("2daa6967-8ecd-4248-97b2-9ad6fefeac14", output_uri))); diff --git a/src/tests/test_metamodel.c b/src/tests/test_metamodel.c index e7e4f2b51..d3003d872 100644 --- a/src/tests/test_metamodel.c +++ b/src/tests/test_metamodel.c @@ -12,11 +12,11 @@ DLiteMetaModel *nodim; MU_TEST(test_metamodel_create) { - model = dlite_metamodel_create("http://meta.sintef.no/0.1/Vehicle", + model = dlite_metamodel_create("http://onto-ns.com/meta/0.1/Vehicle", DLITE_ENTITY_SCHEMA, NULL); mu_check(model); - nodim = dlite_metamodel_create("http://meta.sintef.no/1.0/NoDimension", + nodim = dlite_metamodel_create("http://onto-ns.com/meta/1.0/NoDimension", DLITE_ENTITY_SCHEMA, NULL); mu_check(nodim); diff --git a/src/tests/test_storage_lookup.c b/src/tests/test_storage_lookup.c index b2ce5cea3..daf004d19 100644 --- a/src/tests/test_storage_lookup.c +++ b/src/tests/test_storage_lookup.c @@ -20,7 +20,7 @@ MU_TEST(test_storage_lookup) DLiteStorage *s; char *path = STRINGIFY(dlite_SOURCE_DIR) "/src/tests/*.json"; dlite_storage_paths_append(path); - //mu_check((e = dlite_meta_get("http://meta.sintef.no/0.1/test-entity"))); + //mu_check((e = dlite_meta_get("http://onto-ns.com/meta/0.1/test-entity"))); mu_check((inst = dlite_instance_get("204b05b2-4c89-43f4-93db-fd1cb70f54ef"))); mu_check((s = dlite_storage_open("json", "storage_lookup.json", "mode=w"))); diff --git a/storages/python/python-storage-plugins/blob.py b/storages/python/python-storage-plugins/blob.py index 1c79c80d8..b3ab11813 100644 --- a/storages/python/python-storage-plugins/blob.py +++ b/storages/python/python-storage-plugins/blob.py @@ -31,8 +31,8 @@ def load(self, uuid): with open(self.uri, 'rb') as f: content = f.read() Meta = instance_from_dict({ - 'meta': 'http://meta.sintef.no/0.3/EntitySchema', - 'uri': 'http://meta.sintef.no/0.1/Blob', + 'meta': 'http://onto-ns.com/meta/0.3/EntitySchema', + 'uri': 'http://onto-ns.com/meta/0.1/Blob', 'description': 'Entity representing a single binary blob.', 'dimensions': [], 'properties': [ diff --git a/storages/python/tests/Person.json b/storages/python/tests/Person.json index 58ed83990..329d13508 100644 --- a/storages/python/tests/Person.json +++ b/storages/python/tests/Person.json @@ -1,8 +1,8 @@ { "name": "Person", "version": "0.1", - "namespace": "http://meta.sintef.no", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://onto-ns.com/meta", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "A person.", "dimensions": [ { @@ -31,5 +31,5 @@ "description": "List of skills." } ], - "dataname": "http://meta.sintef.no/0.1/Person" + "dataname": "http://onto-ns.com/meta/0.1/Person" } \ No newline at end of file diff --git a/storages/python/tests/test_postgresql_storage2.c b/storages/python/tests/test_postgresql_storage2.c index a0187e7d0..76106761d 100644 --- a/storages/python/tests/test_postgresql_storage2.c +++ b/storages/python/tests/test_postgresql_storage2.c @@ -22,7 +22,7 @@ char *options = "database=" DATABASE ";user=" USER; MU_TEST(test_load_meta) { DLiteInstance *meta; - char url[256], *id="http://meta.sintef.no/0.1/Person"; + char url[256], *id="http://onto-ns.com/meta/0.1/Person"; snprintf(url, sizeof(url), "postgresql://%s?%s#%s", HOST, options, id); mu_check((meta = dlite_instance_load_url(url))); diff --git a/storages/rdf/tests/data.xml b/storages/rdf/tests/data.xml index b49363dfb..b908e1c78 100644 --- a/storages/rdf/tests/data.xml +++ b/storages/rdf/tests/data.xml @@ -4,10 +4,10 @@ - + - + @@ -52,7 +52,7 @@ - "http://meta.sintef.no" + "http://onto-ns.com/meta" @@ -85,7 +85,7 @@ - + diff --git a/tools/dlite-codegen.c b/tools/dlite-codegen.c index 96e6c3c2d..3205c974d 100644 --- a/tools/dlite-codegen.c +++ b/tools/dlite-codegen.c @@ -174,6 +174,7 @@ int main(int argc, char *argv[]) /* Cleanup */ retval = 0; fail: + printf("failed"); if (inst) dlite_instance_decref(inst); tgen_buf_deinit(&variables); if (template_path) free(template_path); diff --git a/tools/templates/fortran-module.txt b/tools/templates/fortran-module.txt index 2fe43174e..78bdaf3bc 100644 --- a/tools/templates/fortran-module.txt +++ b/tools/templates/fortran-module.txt @@ -72,7 +72,7 @@ module {name} type(DLiteMetaModel) :: model integer :: i if (.not. meta_{name%c}%check()) then - model = DLiteMetaModel('{_uri}', 'http://meta.sintef.no/0.3/EntitySchema', '') + model = DLiteMetaModel('{_uri}', 'http://onto-ns.com/meta/0.3/EntitySchema', '') i = model%add_string('description', '{descr}') {list_dimensions:{@6}i = model%add_dimension('{dim.name}', '{dim.descr}')\n} {list_properties:{@6}i = model%add_property('{prop.name}', '{prop.typename}', '{prop.unit}', '{prop.iri}', '{prop.descr}')\ diff --git a/tools/tests/Chemistry-0.1.json b/tools/tests/Chemistry-0.1.json index c9a59ffd0..3232e30d9 100644 --- a/tools/tests/Chemistry-0.1.json +++ b/tools/tests/Chemistry-0.1.json @@ -1,8 +1,8 @@ { "name": "Chemistry", "version": "0.1", - "namespace": "http://www.sintef.no/calm", - "meta": "http://meta.sintef.no/0.3/EntitySchema", + "namespace": "http://sintef.no/calm", + "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Simple entity with alloy and particle compositions.", "dimensions": [ { @@ -83,4 +83,4 @@ } ], "dataname": "http://www.sintef.no/calm/0.1/Chemistry" -} \ No newline at end of file +} From b5454b7ae945651e74a349f147deec659664434f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Tore=20L=C3=B8vfall?= Date: Tue, 6 Jul 2021 12:05:35 +0200 Subject: [PATCH 2/5] Removed debug print statement --- tools/dlite-codegen.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/dlite-codegen.c b/tools/dlite-codegen.c index 3205c974d..96e6c3c2d 100644 --- a/tools/dlite-codegen.c +++ b/tools/dlite-codegen.c @@ -174,7 +174,6 @@ int main(int argc, char *argv[]) /* Cleanup */ retval = 0; fail: - printf("failed"); if (inst) dlite_instance_decref(inst); tgen_buf_deinit(&variables); if (template_path) free(template_path); From 69dd28308822bb0c2096aa0006934d5605ba2664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Tore=20L=C3=B8vfall?= Date: Tue, 6 Jul 2021 12:42:37 +0200 Subject: [PATCH 3/5] Updated uuid for Entity, Collection and BasicMetadata With new default uri, the hard coded uuid had to be updated --- src/dlite-schemas.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dlite-schemas.c b/src/dlite-schemas.c index 0e13432b9..3926e668b 100644 --- a/src/dlite-schemas.c +++ b/src/dlite-schemas.c @@ -114,7 +114,7 @@ static struct _BasicMetadataSchema { size_t __propoffsets[7]; } basic_metadata_schema = { /* -- header */ - "89cc72b5-1ced-54eb-815b-8fffc16c42d1", /* uuid (corresponds to uri) */ + "a8194052-7d3b-530f-ba1e-7e82fd51bf31", /* uuid (corresponds to uri) */ DLITE_BASIC_METADATA_SCHEMA, /* uri */ 1, /* _refcount, never free */ (DLiteMeta *)&basic_metadata_schema, /* meta */ @@ -270,7 +270,7 @@ static struct _EntitySchema { size_t __propoffsets[6]; } entity_schema = { /* -- header */ - "57742a73-ba65-5797-aebf-c1a270c4d02b", /* uuid (corresponds to uri) */ + "46168985-705c-5029-b856-3ee1cccccefc", /* uuid (corresponds to uri) */ DLITE_ENTITY_SCHEMA, /* uri */ 1, /* _refcount, never free */ (DLiteMeta *)&basic_metadata_schema, /* meta */ @@ -368,7 +368,7 @@ static struct _CollectionEntity { size_t __propoffsets[1]; } collection_entity = { /* -- header */ - "8948745c-904c-5599-834a-9f59613fb6c5", /* uuid (corresponds to uri) */ + "96f31fc3-3838-5cb8-8d90-eddee6ff59ca", /* uuid (corresponds to uri) */ DLITE_COLLECTION_ENTITY, /* uri */ 1, /* _refcount, never free */ (DLiteMeta *)&entity_schema, /* meta */ From 24f1e173eddcd5ef88e7d9e68273e3a00a0acb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Tore=20L=C3=B8vfall?= Date: Wed, 7 Jul 2021 09:12:47 +0200 Subject: [PATCH 4/5] Updated test to work with onto-ns.com --- bindings/python/tests/test_entity.py | 2 +- src/dlite-schemas.c | 3 +++ src/tests/test_print.c | 8 ++++---- tools/tests/Chemistry-0.1.json | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bindings/python/tests/test_entity.py b/bindings/python/tests/test_entity.py index 25c2f6d91..f00d9d5e9 100755 --- a/bindings/python/tests/test_entity.py +++ b/bindings/python/tests/test_entity.py @@ -16,7 +16,7 @@ print(myentity.uuid) # Check some properties of the entity -assert myentity.uuid == 'ea34bc5e-de88-544d-bcba-150b7292873d' +assert myentity.uuid == 'a0e63529-3397-5c4f-a56c-14bf07ecc219' assert myentity.uri == 'http://onto-ns.com/meta/0.1/MyEntity' assert myentity.dimensions == {'ndimensions': 2, 'nproperties': 14} assert not myentity.is_data diff --git a/src/dlite-schemas.c b/src/dlite-schemas.c index 3926e668b..33dc7e8ec 100644 --- a/src/dlite-schemas.c +++ b/src/dlite-schemas.c @@ -428,6 +428,7 @@ int dlite_meta_init(DLiteMeta *meta); const DLiteMeta *dlite_get_basic_metadata_schema() { + dlite_get_uuid(basic_metadata_schema.uuid, DLITE_BASIC_METADATA_SCHEMA); if (!basic_metadata_schema._headersize) dlite_meta_init((DLiteMeta *)&basic_metadata_schema); return (DLiteMeta *)&basic_metadata_schema; @@ -435,6 +436,7 @@ const DLiteMeta *dlite_get_basic_metadata_schema() const DLiteMeta *dlite_get_entity_schema() { + dlite_get_uuid(entity_schema.uuid, DLITE_ENTITY_SCHEMA); if (!entity_schema._headersize) dlite_meta_init((DLiteMeta *)&entity_schema); return (DLiteMeta *)&entity_schema; @@ -442,6 +444,7 @@ const DLiteMeta *dlite_get_entity_schema() const DLiteMeta *dlite_get_collection_entity() { + dlite_get_uuid(collection_entity.uuid, DLITE_COLLECTION_ENTITY); if (!collection_entity._headersize) dlite_meta_init((DLiteMeta *)&collection_entity); return (DLiteMeta *)&collection_entity; diff --git a/src/tests/test_print.c b/src/tests/test_print.c index 3cbea2bcf..5e3c69c04 100644 --- a/src/tests/test_print.c +++ b/src/tests/test_print.c @@ -39,22 +39,22 @@ MU_TEST(test_sprint) m = dlite_json_sprint(buf, sizeof(buf), (DLiteInstance *)meta, 0, 0); printf("\n--------------------------------------------------------\n"); printf("%s\n", buf); - mu_assert_int_eq(1062, m); + mu_assert_int_eq(1066, m); m = dlite_json_sprint(buf, sizeof(buf), (DLiteInstance *)meta, 2, dliteJsonUuid | dliteJsonMetaAsData); printf("\n--------------------------------------------------------\n"); printf("%s\n", buf); - mu_assert_int_eq(1146, m); + mu_assert_int_eq(1152, m); printf("\n========================================================\n"); m = dlite_json_sprint(buf, sizeof(buf), inst, 4, 0); printf("%s\n", buf); - mu_assert_int_eq(369, m); + mu_assert_int_eq(371, m); printf("\n--------------------------------------------------------\n"); m = dlite_json_sprint(buf, 80, inst, 4, 0); - mu_assert_int_eq(369, m); + mu_assert_int_eq(371, m); } diff --git a/tools/tests/Chemistry-0.1.json b/tools/tests/Chemistry-0.1.json index 3232e30d9..c8dd6cfaa 100644 --- a/tools/tests/Chemistry-0.1.json +++ b/tools/tests/Chemistry-0.1.json @@ -1,7 +1,7 @@ { "name": "Chemistry", "version": "0.1", - "namespace": "http://sintef.no/calm", + "namespace": "http://www.sintef.no/calm", "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Simple entity with alloy and particle compositions.", "dimensions": [ @@ -83,4 +83,4 @@ } ], "dataname": "http://www.sintef.no/calm/0.1/Chemistry" -} +} \ No newline at end of file From e036398ec634505554571e28052881d571e23fb4 Mon Sep 17 00:00:00 2001 From: Jesper Friis Date: Wed, 7 Jul 2021 15:20:28 +0200 Subject: [PATCH 5/5] Fixed some tests --- bindings/python/tests/test_entity.py | 2 +- examples/ex1/Chemistry-0.1.json | 4 ++-- examples/ex1/main.c | 2 +- examples/ex2/Chemistry-0.1.json | 4 ++-- examples/ex2/main.c | 2 +- examples/ex4/Chemistry-0.1.json | 4 ++-- examples/storages/Chemistry-0.1.json | 6 +++--- src/tests/alloys.json | 2 +- src/tests/test_json_entity.c | 4 ++-- src/tests/test_print.c | 8 ++++---- src/tests/test_store.c | 2 +- tools/tests/Chemistry-0.1.json | 4 ++-- tools/tests/test_codegen.c | 2 +- tools/tests/test_ext_header.c | 2 +- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/bindings/python/tests/test_entity.py b/bindings/python/tests/test_entity.py index 25c2f6d91..f00d9d5e9 100755 --- a/bindings/python/tests/test_entity.py +++ b/bindings/python/tests/test_entity.py @@ -16,7 +16,7 @@ print(myentity.uuid) # Check some properties of the entity -assert myentity.uuid == 'ea34bc5e-de88-544d-bcba-150b7292873d' +assert myentity.uuid == 'a0e63529-3397-5c4f-a56c-14bf07ecc219' assert myentity.uri == 'http://onto-ns.com/meta/0.1/MyEntity' assert myentity.dimensions == {'ndimensions': 2, 'nproperties': 14} assert not myentity.is_data diff --git a/examples/ex1/Chemistry-0.1.json b/examples/ex1/Chemistry-0.1.json index 16b4832f0..b25b800cd 100644 --- a/examples/ex1/Chemistry-0.1.json +++ b/examples/ex1/Chemistry-0.1.json @@ -1,7 +1,7 @@ { "name": "Chemistry", "version": "0.1", - "namespace": "http://www.sintef.no/calm", + "namespace": "http://sintef.no/calm", "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Simple entity with alloy and particle compositions.", "dimensions": [ @@ -82,5 +82,5 @@ "description": "Average volume per atom for each phase." } ], - "dataname": "http://www.sintef.no/calm/0.1/Chemistry" + "dataname": "http://sintef.no/calm/0.1/Chemistry" } diff --git a/examples/ex1/main.c b/examples/ex1/main.c index 8e361a8bd..71ac7b249 100644 --- a/examples/ex1/main.c +++ b/examples/ex1/main.c @@ -25,7 +25,7 @@ int main() /* Load Chemistry entity */ s = dlite_storage_open("json", path, "mode=r"); chem = (DLiteMeta *) - dlite_meta_load(s, "http://www.sintef.no/calm/0.1/Chemistry"); + dlite_meta_load(s, "http://sintef.no/calm/0.1/Chemistry"); dlite_storage_close(s); /* Create instance */ diff --git a/examples/ex2/Chemistry-0.1.json b/examples/ex2/Chemistry-0.1.json index 16b4832f0..b25b800cd 100644 --- a/examples/ex2/Chemistry-0.1.json +++ b/examples/ex2/Chemistry-0.1.json @@ -1,7 +1,7 @@ { "name": "Chemistry", "version": "0.1", - "namespace": "http://www.sintef.no/calm", + "namespace": "http://sintef.no/calm", "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Simple entity with alloy and particle compositions.", "dimensions": [ @@ -82,5 +82,5 @@ "description": "Average volume per atom for each phase." } ], - "dataname": "http://www.sintef.no/calm/0.1/Chemistry" + "dataname": "http://sintef.no/calm/0.1/Chemistry" } diff --git a/examples/ex2/main.c b/examples/ex2/main.c index 0e6b3c855..719842f16 100644 --- a/examples/ex2/main.c +++ b/examples/ex2/main.c @@ -29,7 +29,7 @@ int main() /* Load Chemistry entity */ s = dlite_storage_open("json", path, "mode=r"); chem = (DLiteMeta *) - dlite_meta_load(s, "http://www.sintef.no/calm/0.1/Chemistry"); + dlite_meta_load(s, "http://sintef.no/calm/0.1/Chemistry"); dlite_storage_close(s); /* Create instance */ diff --git a/examples/ex4/Chemistry-0.1.json b/examples/ex4/Chemistry-0.1.json index 16b4832f0..b25b800cd 100644 --- a/examples/ex4/Chemistry-0.1.json +++ b/examples/ex4/Chemistry-0.1.json @@ -1,7 +1,7 @@ { "name": "Chemistry", "version": "0.1", - "namespace": "http://www.sintef.no/calm", + "namespace": "http://sintef.no/calm", "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Simple entity with alloy and particle compositions.", "dimensions": [ @@ -82,5 +82,5 @@ "description": "Average volume per atom for each phase." } ], - "dataname": "http://www.sintef.no/calm/0.1/Chemistry" + "dataname": "http://sintef.no/calm/0.1/Chemistry" } diff --git a/examples/storages/Chemistry-0.1.json b/examples/storages/Chemistry-0.1.json index c8dd6cfaa..b25b800cd 100644 --- a/examples/storages/Chemistry-0.1.json +++ b/examples/storages/Chemistry-0.1.json @@ -1,7 +1,7 @@ { "name": "Chemistry", "version": "0.1", - "namespace": "http://www.sintef.no/calm", + "namespace": "http://sintef.no/calm", "meta": "http://onto-ns.com/meta/0.3/EntitySchema", "description": "Simple entity with alloy and particle compositions.", "dimensions": [ @@ -82,5 +82,5 @@ "description": "Average volume per atom for each phase." } ], - "dataname": "http://www.sintef.no/calm/0.1/Chemistry" -} \ No newline at end of file + "dataname": "http://sintef.no/calm/0.1/Chemistry" +} diff --git a/src/tests/alloys.json b/src/tests/alloys.json index 15453dfdb..fd6396f7d 100644 --- a/src/tests/alloys.json +++ b/src/tests/alloys.json @@ -3,7 +3,7 @@ "meta": { "name": "Chemistry", "version": "0.1", - "namespace": "http://www.sintef.no/calm" + "namespace": "http://sintef.no/calm" }, "dimensions": { "nelements": 3, diff --git a/src/tests/test_json_entity.c b/src/tests/test_json_entity.c index 53fafb69a..1d2359cdc 100644 --- a/src/tests/test_json_entity.c +++ b/src/tests/test_json_entity.c @@ -25,7 +25,7 @@ MU_TEST(test_entity_load) DLiteStorage *s; DLiteInstance *e; /* the entity cast to a DLiteInstance */ char *path = STRINGIFY(dlite_SOURCE_DIR) "/tools/tests/Chemistry-0.1.json"; - char *uri = "http://www.sintef.no/calm/0.1/Chemistry"; + char *uri = "http://sintef.no/calm/0.1/Chemistry"; mu_check((s = dlite_storage_open("json", path, "mode=r"))); mu_check((entity = dlite_meta_load(s, uri))); @@ -100,7 +100,7 @@ MU_TEST(test_instance_load) int nprops = dlite_instance_get_dimension_size(e, "nproperties"); int *dims = calloc(ndims, sizeof(int)); char *id = "8411a72c-c7a3-5a6a-b126-1e90b8a55ae2"; - //char *id = "http://www.sintef.no/calm/0.1/Chemistry"; + //char *id = "http://sintef.no/calm/0.1/Chemistry"; // cppcheck-suppress memleak mu_check((s = dlite_storage_open("json", path, "mode=r"))); diff --git a/src/tests/test_print.c b/src/tests/test_print.c index 3cbea2bcf..5e3c69c04 100644 --- a/src/tests/test_print.c +++ b/src/tests/test_print.c @@ -39,22 +39,22 @@ MU_TEST(test_sprint) m = dlite_json_sprint(buf, sizeof(buf), (DLiteInstance *)meta, 0, 0); printf("\n--------------------------------------------------------\n"); printf("%s\n", buf); - mu_assert_int_eq(1062, m); + mu_assert_int_eq(1066, m); m = dlite_json_sprint(buf, sizeof(buf), (DLiteInstance *)meta, 2, dliteJsonUuid | dliteJsonMetaAsData); printf("\n--------------------------------------------------------\n"); printf("%s\n", buf); - mu_assert_int_eq(1146, m); + mu_assert_int_eq(1152, m); printf("\n========================================================\n"); m = dlite_json_sprint(buf, sizeof(buf), inst, 4, 0); printf("%s\n", buf); - mu_assert_int_eq(369, m); + mu_assert_int_eq(371, m); printf("\n--------------------------------------------------------\n"); m = dlite_json_sprint(buf, 80, inst, 4, 0); - mu_assert_int_eq(369, m); + mu_assert_int_eq(371, m); } diff --git a/src/tests/test_store.c b/src/tests/test_store.c index 916ed746a..a21ca4d5e 100644 --- a/src/tests/test_store.c +++ b/src/tests/test_store.c @@ -16,7 +16,7 @@ DLiteMeta *entity = NULL; DLiteInstance *inst = NULL; DLiteStore *store = NULL; -char *entity_uri = "http://www.sintef.no/calm/0.1/Chemistry"; +char *entity_uri = "http://sintef.no/calm/0.1/Chemistry"; char *inst_id = "8411a72c-c7a3-5a6a-b126-1e90b8a55ae2"; diff --git a/tools/tests/Chemistry-0.1.json b/tools/tests/Chemistry-0.1.json index 3232e30d9..32c722e04 100644 --- a/tools/tests/Chemistry-0.1.json +++ b/tools/tests/Chemistry-0.1.json @@ -82,5 +82,5 @@ "description": "Average volume per atom for each phase." } ], - "dataname": "http://www.sintef.no/calm/0.1/Chemistry" -} + "dataname": "http://sintef.no/calm/0.1/Chemistry" +} \ No newline at end of file diff --git a/tools/tests/test_codegen.c b/tools/tests/test_codegen.c index c65616754..a8ac03cf4 100644 --- a/tools/tests/test_codegen.c +++ b/tools/tests/test_codegen.c @@ -27,7 +27,7 @@ int main() /* Load Chemistry entity */ s = dlite_storage_open("json", path, "mode=r"); chem = (DLiteMeta *) - dlite_meta_load(s, "http://www.sintef.no/calm/0.1/Chemistry"); + dlite_meta_load(s, "http://sintef.no/calm/0.1/Chemistry"); dlite_storage_close(s); /* Create instance */ diff --git a/tools/tests/test_ext_header.c b/tools/tests/test_ext_header.c index e23902c51..4ca3c1d56 100644 --- a/tools/tests/test_ext_header.c +++ b/tools/tests/test_ext_header.c @@ -39,7 +39,7 @@ int main() /* Load Chemistry metadata and call DLITE_UPDATE_EXTENEDE_META() to make it aware of its additional fields. */ s = dlite_storage_open("json", path, "mode=r"); - chem = dlite_meta_load(s, "http://www.sintef.no/calm/0.1/Chemistry"); + chem = dlite_meta_load(s, "http://sintef.no/calm/0.1/Chemistry"); dlite_storage_close(s); DLITE_UPDATE_EXTENEDE_META(chem, Chemistry, nelements);