Skip to content

Commit

Permalink
reference to statement.subject and .object without revision
Browse files Browse the repository at this point in the history
In the SpecIF 0.10.x branch there are no revisions (SpecIF "Level-1"). Since identifiers of all entities must be unique, a reference with specified revision for statement.subject and .object must point to the supplied entitiy to which the revision is constrained.
Note that entities with several revisions can be supplied and references to specific revisions can be made in SpecIF 0.11.1 and later.
  • Loading branch information
odungern committed Jan 21, 2018
1 parent a155a19 commit 23fbf92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
4 changes: 2 additions & 2 deletions check/specif-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ function checkConstraints(data) {
// Similarly for "object".
// (It has been checked before that any "resource" is indeed of type "resourceType").
for( var i=rL.length-1;i>-1;i-- ){
if(indexById(oL, rL[i].subject.id)<0) return {status:908, statusText: "subject of statement with identifier '"+rL[i].id+"' must reference a valid resource"};
if(indexById(oL, rL[i].object.id)<0) return {status:909, statusText: "object of statement with identifier '"+rL[i].id+"' must reference a valid resource"};
if(indexById(oL, rL[i].subject)<0) return {status:908, statusText: "subject of statement with identifier '"+rL[i].id+"' must reference a valid resource"};
if(indexById(oL, rL[i].object)<0) return {status:909, statusText: "object of statement with identifier '"+rL[i].id+"' must reference a valid resource"};
// if( rL[i].subject == rL[i].object ) return {status:90X, statusText: ""}
};
return {status:0, statusText: "statement's subjects and objects reference valid resources"}
Expand Down
26 changes: 4 additions & 22 deletions schema/specif-schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "http://specif.de/v0.10.0/schema#",
"id": "http://specif.de/v0.10.1/schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON-Schema for SpecIF v0.10.0",
"title": "JSON-Schema for SpecIF v0.10.1",
"description": "SpecIF represents the visible, i.e. the diagrams and the text, as well as the semantics of system specifications for model integration and model exchange.",
"definitions": {
"id": {
Expand Down Expand Up @@ -449,28 +449,10 @@
"$ref": "#/definitions/id"
},
"subject": {
"type": "object",
"properties": {
"id": {
"$ref": "#/definitions/id"
},
"revision": {
"$ref": "#/definitions/revision"
}
},
"required": [ "id" ]
"$ref": "#/definitions/id"
},
"object": {
"type": "object",
"properties": {
"id": {
"$ref": "#/definitions/id"
},
"revision": {
"$ref": "#/definitions/revision"
}
},
"required": [ "id" ]
"$ref": "#/definitions/id"
},
"properties": {
"$ref": "#/definitions/properties"
Expand Down

0 comments on commit 23fbf92

Please sign in to comment.