Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check PROMCODE vocabs and shapes for publication #278

Open
berezovskyi opened this issue Sep 28, 2020 · 21 comments
Open

Check PROMCODE vocabs and shapes for publication #278

berezovskyi opened this issue Sep 28, 2020 · 21 comments

Comments

@berezovskyi
Copy link
Member Author

Expected URIs from the files:

@jamsden please confirm the URIs

@berezovskyi
Copy link
Member Author

  • shapechecker run ad-hoc on shapes
  • add vocab metadata
  • decide what to do with multiple shape bases
  • code blocks shall always be inside XML literals, not strings but the other way around when there is no need

@mwakao
Copy link

mwakao commented Oct 22, 2020

@berezovskyi, do we have anything to do to make progress?

@berezovskyi
Copy link
Member Author

Hello @mwakao,

My apologies for a late reply! It would be great if you could make 2 pull requests, one under https://github.com/oslc-op/website/tree/master/content/ns for the files themselves and another to https://github.com/oslc-op/website-content-negotiation/blob/master/negotiation.js#L53 for the content negotiation URIs and then we can start a more formal review.

One thing you should look at immediately is the number of URL bases you are publishing in your files. In the OP, we take a strong view that every URL defined in the files must be dereferenceable. For example, if you define http://open-services.net/ns/promcode/shapes/1.0/ArtifactContainer resource, then there should be an ArtifactContainer.ttl file that we can serve when a Linked Data tool tries to dereference http://open-services.net/ns/promcode/shapes/1.0/ArtifactContainer URL. We discussed this in the OSLC OP for our own specs and agreed to have just 2 files, one for vocabs and one for shapes for the sake of simplicity. If you do the same, make sure that all classes, resources, properties have one of the two URL bases and no more.

  • each file shall only define resources under the URL base == URL where the file will be published

You should also put a license on the Turtle files. Please put any OSS license on them so that we are allowed to redistribute them but also that anyone downloading them has the right to use them too. BSD-3-Simple is a good choice if you have not decided yet.

  • each file shall have a permissive OSS license header

You should also have RDF metadata on both vocabs and shapes, see https://github.com/oslc-op/oslc-specs/blob/master/specs/core/core-vocab.ttl#L23 and https://github.com/oslc-op/oslc-specs/blob/master/specs/core/core-shapes.ttl#L25 for an example.

Your files shall pass the ShapeCheck validation, please see https://github.com/oslc-op/oslc-specs/tree/master/tools/ShapeChecker for the tool itself and https://github.com/oslc-op/oslc-specs/tree/master/tools/ShapeChecker/scripts for the sample scripts we use to validate specs under OSLC OP.

Please do not rely on @base but instead try to use a named or blank prefix (eg oslc_prom: or : respectively). If you don't want to follow this recommendation, you must ensure that the subject URIs are uniformly consistent in your files. For example, avoid :Artifact and <#oslc_promcode> in the same file.

Finally, we can work on all of these now but let's ensure the files are published (with all the needed fixes listed above) as a Committee Specification on OASIS archive before we deploy them on our site. For our specs, we set the bar at the Candidate OASIS Standard but we can relax it one step for external specs.

I know it's quite a lot of work and I am ready to help out in any way I can. I am in the CET+2 timezone and glad to have a call if needed.

Best regards,
Andrew

@ShigeakiMatsumoto
Copy link

ShigeakiMatsumoto commented Mar 22, 2021

Hello @berezovskyi, @mwakao,

I have been working with @mwakao for PROMCODE vocab and shapes.
I confirmed current core shapes definition as follows:
https://github.com/oslc-op/oslc-specs/blob/master/specs/core/core-shapes.ttl

Also, I found each shape definition are stored in this location:
http://docs.oasis-open.org/oslc-core/oslc-core/v3.0/csprd03/shapes/

I'd like to know how to generate core-shapes.ttl from each resource ttl file.
Are there any scripts to generate core-shapes.ttl ?

If there are no relation between core-shape.ttl and each resource ttl file,
we would like to maintain only a merged shape ttl file such as core-shape.ttl.

@berezovskyi
Copy link
Member Author

berezovskyi commented Mar 30, 2021

Dear Shigeaki-san, Masaki-san,

I am sorry for a late reply!

We did not generate the "aggregate" shape automatically. Instead, we decided it will be easier to join them (more importantly, to publish them) and did the work by hand. It helps if you set a common prefix for all shapes first so that you can copypaste the Turtle across files without risking URIs to change inadvertently. See oslc-op/oslc-specs@c9e4357#diff-0ae6717a06b9a0a9f3e28a69c26765fc656a823035758f8d4d12d2f27080f7baR20 for an example of a prefix. As you see, we also use a base for the resources that are defined as <#Comment> instead of :Comment. Both are set to the same URI. You can then use a riot tool from Apache Jena to "beautify" the files (but the beautification is not the main task, instead we want to make sure the URIs are correctly interpreted by an RDF lib):

riot -q --check --stop --formatted=turtle shapes/single.ttl > core-shapes.ttl

You can also try to do the merge automatically and check the output:

riot -q --check --stop --formatted=turtle shapes/* > core-shapes.ttl

/Andrew

P.S. https://github.com/oslc-op/oslc-specs/blob/master/specs/core/core-shapes.ttl correspond to the shapes published under https://docs.oasis-open-projects.org/oslc-op/core/v3.0/ps01/. The old TC is now closed, all of its unpublished work is obsolete.

P.P.S. Do not forget the OASIS copyright header at the top.

@berezovskyi
Copy link
Member Author

@tomkamimura I took another look following a request from @jamsden and will post my findings here (because you keep closing your pull requests and opening new ones, please don't do as it makes it hard for us to see what did you change in your newest updates).

I updated the shapecheck command this way:

build/install/ShapeChecker/bin/ShapeChecker \
-t Warning \
-C ${comment# Enforce check for ResourceShapeConstraints} \
-q EmbeddedWhitespace \
-q MissingPeriod \
-x 'http://open-services.net/ns/promcode' ${comment# See https://github.com/oslc-op/oslc-specs/issues/40} \
-x 'http://open-services.net/ns/promcode#.*' ${comment# See https://github.com/oslc-op/oslc-specs/issues/40} \
-x 'http://purl.org/dc/terms/' ${comment# See https://github.com/oslc-op/oslc-specs/issues/320} \
-x 'http://purl.org/dc/terms/.*' ${comment# See https://github.com/oslc-op/oslc-specs/issues/320} \
-v /Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-vocab.ttl \
-s /Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-shapes.ttl

You will need to replace the file paths to work on your system.

Here is the full report of the tool:

Results from ShapeChecker run on Thu Feb 17 16:55:23 CET 2022

Command line arguments:
   -t Warning -C -q EmbeddedWhitespace -q MissingPeriod -x http://open-services.net/ns/promcode -x
   http://open-services.net/ns/promcode#.* -x http://purl.org/dc/terms/ -x http://purl.org/dc/terms/.* -v
   /Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-vocab.ttl -s
   /Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-shapes.ttl

A total of 2 issues were found (0 info, 2 warnings, 0 errors)

Checked vocabulary http://open-services.net/ns/promcode# from file:/Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-vocab.ttl, with 0 issues (0 info, 0 warnings, 0 errors)

Checked shapes from file:/Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-shapes.ttl, with 1 issue (0 info, 1 warnings, 0 errors)
   While examining resource shape http://open-services.net/ns/promcode/shapes/1.0#WorkItem:
      Warning on http://open-services.net/ns/core#name: This property is unexpected. (bad value WorkItem)

Warning: This vocabulary was given, but not referenced in the given shapes:
   file:/Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-vocab.ttl

Please check the report and tell us if those are valid problems and how will we fix them. @jamsden please check as well.

@berezovskyi
Copy link
Member Author

I can confirm that the shape in question has such a property:

:WorkItem a oslc:ResourceShape ;
    oslc:describes oslc_promcode:WorkItem ;
    oslc:name "WorkItem" ;
    oslc:property [ a oslc:Property ;
				    oslc:name "actualEndDate" ;
				    oslc:occurs oslc:Zero-or-one ;
				    oslc:propertyDefinition oslc_promcode:actualEndDate ;
				    oslc:valueType xsd:dateTime ;
				    dcterms:description "<code>actualEndDate</code> is a property of a <code>WorkItem</code> resource. It is the actual end date of the work item. Its value is of type <code>xsd:dateTime</code>." 
                  ];

And I can confirm that other shapes don't use this predicate. The OSLC spec states: Name of property being defined, i.e. second part of property's Prefixed Name. For all other uses, consider dcterms:title, rdfs:label, oslc:shortTitle or oslc:label. https://docs.oasis-open-projects.org/oslc-op/core/v3.0/os/core-vocab.html#name

@berezovskyi
Copy link
Member Author

Also, you are mixing tabs and spaces in the file, consider using only one for consistency:

image

@tomkamimura
Copy link
Contributor

We modified our shape.ttl file by deleting oslc:name "WorkItem" line which is not necessary. Also, we corrected the mixing of tab and space characters. Then, we ran ShapeChecker. For some reasons, it generated no errors and 17 warnings. Most of the warnings are probably due to URL's not reachable and redirecting not working in our environment. Of two warnings you indicated above, the first one is gone. The second one still exists, which is "Warning: This vocabulary was given, but not referenced in the given shapes: ..." It is true that shape.ttl does not reference vocab.ttl. I looked at change-mgt-shapes.ttl. It does not reference their vocab.ttl either So, is this a problem?

I have replaced our turtle files in our repo that is requested to merge to your main repo by the latest open PQ at #307

Here is a result of ShapeChecker to our ttl files.

Results from ShapeChecker run on Thu Feb 24 14:39:53 JST 2022Command line arguments:
-t Warning -C -q EmbeddedWhitespace -q MissingPeriod -x 'http://open-services.net/ns/promcode' -x
'http://open-services.net/ns/promcode#.' -x 'http://purl.org/dc/terms/' -x 'http://purl.org/dc/terms/.' -v
..........\oslc-promcode\shape\trunk\promcode-vocab.ttl -s
..........\oslc-promcode\shape\trunk\promcode-shapes.ttl

A total of 17 issues were found (0 info, 17 warnings, 0 errors)

Checked vocabulary http://open-services.net/ns/promcode# from file:/D:/ICF_AutoCapsule_disabled/oslc-cheker/oslc-specs/tools/ShapeChecker/scripts/../../../../../oslc-promcode/shape/trunk/promcode-vocab.ttl, with 3 issues (0 info, 3 warnings, 0 errors)
While examining ontology http://open-services.net/ns/promcode#:
Warning on https://open-services.net/about/: This resource is not fetchable. (bad value org.apache.http.conn.HttpHostConnectException: Connect to open-services.net:443 [open-services.net/165.227.5.255] failed: Connection timed out: connect)
Warning on https://docs.oasis-open.org/oslc-promcode/promcode/v1.0/cs02/promcode-spec.html: This resource is not fetchable. (bad value org.apache.http.conn.HttpHostConnectException: Connect to docs.oasis-open.org:443 [docs.oasis-open.org/148.62.4.174] failed: Connection timed out: connect)
Warning on https://docs.oasis-open.org/oslc-promcode/promcode/v1.0/cs02/promcode-vocab.ttl: This resource is not fetchable. (bad value org.apache.http.conn.HttpHostConnectException: Connect to docs.oasis-open.org:443 [docs.oasis-open.org/148.62.4.174] failed: Connection timed out: connect)

Checked shapes from file:/D:/ICF_AutoCapsule_disabled/oslc-cheker/oslc-specs/tools/ShapeChecker/scripts/../../../../../oslc-promcode/shape/trunk/promcode-shapes.ttl, with 13 issues (0 info, 13 warnings, 0 errors)
Warning on https://open-services.net/about/: This resource is not fetchable. (bad value org.apache.http.conn.HttpHostConnectException: Connect to open-services.net:443 [open-services.net/165.227.5.255] failed: Connection timed out: connect)
Warning on https://docs.oasis-open.org/oslc-promcode/promcode/v1.0/cs02/promcode-shapes.ttl: This resource is not fetchable. (bad value org.apache.http.conn.HttpHostConnectException: Connect to docs.oasis-open.org:443 [docs.oasis-open.org/148.62.4.174] failed: Connection timed out: connect)
Warning on https://docs.oasis-open.org/oslc-promcode/promcode/v1.0/cs02/promcode-spec.html: This resource is not fetchable. (bad value org.apache.http.conn.HttpHostConnectException: Connect to docs.oasis-open.org:443 [docs.oasis-open.org/148.62.4.174] failed: Connection timed out: connect)
While examining resource shape http://open-services.net/ns/promcode/shapes/1.0#Report:
While examining property definition date:
Warning on http://purl.org/dc/terms/date: This resource is not fetchable. (bad value org.apache.jena.atlas.web.HttpException: org.apache.http.conn.HttpHostConnectException: Connect to purl.org:80 [purl.org/207.241.239.242] failed: Connection timed out: connect)
While examining resource shape http://open-services.net/ns/promcode/shapes/1.0#Project:
Warning on http://open-services.net/ns/promcode#Project: This resource is not fetchable. (bad value org.apache.jena.atlas.web.HttpException: org.apache.http.conn.HttpHostConnectException: Connect to open-services.net:80 [open-services.net/165.227.5.255] failed: Connection timed out: connect)
While examining property definition description:
Warning on http://purl.org/dc/terms/description: This resource is not fetchable. (bad value org.apache.jena.atlas.web.HttpException: org.apache.http.conn.HttpHostConnectException: Connect to purl.org:80 [purl.org/207.241.239.242] failed: Connection timed out: connect)
While examining property definition source:
Warning on http://purl.org/dc/terms/source: This resource is not fetchable. (bad value org.apache.jena.atlas.web.HttpException: org.apache.http.conn.HttpHostConnectException: Connect to purl.org:80 [purl.org/207.241.239.242] failed: Connection timed out: connect)
While examining property definition title:
Warning on http://purl.org/dc/terms/title: This resource is not fetchable. (bad value org.apache.jena.atlas.web.HttpException: org.apache.http.conn.HttpHostConnectException: Connect to purl.org:80 [purl.org/207.241.239.242] failed: Connection timed out: connect)
Warning on http://open-services.net/ns/core#Zero-or-one: This resource is not fetchable. (bad value org.apache.jena.atlas.web.HttpException: org.apache.http.conn.HttpHostConnectException: Connect to open-services.net:80 [open-services.net/165.227.5.255] failed: Connection timed out: connect)
While examining property definition identifier:
Warning on http://purl.org/dc/terms/identifier: This resource is not fetchable. (bad value org.apache.jena.atlas.web.HttpException: org.apache.http.conn.HttpHostConnectException: Connect to purl.org:80 [purl.org/207.241.239.242] failed: Connection timed out: connect)
While examining property definition type:
Warning on http://www.w3.org/2000/01/rdf-schema#Class: This resource is not fetchable. (bad value org.apache.jena.atlas.web.HttpException: org.apache.http.conn.HttpHostConnectException: Connect to www.w3.org:80 [www.w3.org/128.30.52.100] failed: Connection timed out: connect)
Warning on http://www.w3.org/1999/02/22-rdf-syntax-ns#type: This resource is not fetchable. (bad value org.apache.jena.atlas.web.HttpException: org.apache.http.conn.HttpHostConnectException: Connect to www.w3.org:80 [www.w3.org/128.30.52.100] failed: Connection timed out: connect)
While examining resource shape http://open-services.net/ns/promcode/shapes/1.0#Artifact:
While examining property definition isPartOf:
Warning on http://purl.org/dc/terms/isPartOf: This resource is not fetchable. (bad value org.apache.jena.atlas.web.HttpException: org.apache.http.conn.HttpHostConnectException: Connect to purl.org:80 [purl.org/207.241.239.242] failed: Connection timed out: connect)

Warning: This vocabulary was given, but not referenced in the given shapes:

file:/D:/ICF_AutoCapsule_disabled/oslc-cheker/oslc-specs/tools/ShapeChecker/scripts/../../../../../oslc-promcode/shape/trunk/promcode-vocab.ttl
D:\ICF_AutoCapsule_disabled\oslc-cheker\oslc-specs\tools\ShapeChecker\scripts> 

@tomkamimura
Copy link
Contributor

One more comment to add. We have updated our spec document that has been approved as CS03. It will be published at OASIS library in a few days. As a result, the version is changed to CS03 in the updated version of promcode-shapes.ttl and promcode-vocab.ttl files.

@tomkamimura
Copy link
Contributor

I ran ShapeChecker again on the lastest promcode-shapes.ttl and promcode-voca.ttl today (March 2, 2022). One warning generated which says that shapes.ttl does not refernce voca.ttl. Here is the result.

Results from ShapeChecker run on Wed Mar 02 15:16:52 JST 2022

Command line arguments:
-t Warning -C -q EmbeddedWhitespace -q MissingPeriod -x http://open-services.net/ns/promcode -x
http://open-services.net/ns/promcode#.* -x http://purl.org/dc/terms/ -x http://purl.org/dc/terms/.* -v
/Users/tomkamimura/PROMCODE/oslc-promcode/PROMCODE/turtle_files/promcode-vocab.ttl -s
../../../turtle_files/promcode-shapes.ttl

A total of 1 issue was found (0 info, 1 warnings, 0 errors)

Checked vocabulary file:/Users/tomkamimura/PROMCODE/oslc-promcode/PROMCODE/turtle_files/promcode-vocab.ttl from file:/Users/tomkamimura/PROMCODE/oslc-promcode/PROMCODE/turtle_files/promcode-vocab.ttl, with 0 issues (0 info, 0 warnings, 0 errors)

Checked shapes from file:/Users/tomkamimura/PROMCODE/oslc-promcode/PROMCODE/build/install/ShapeChecker/../../../turtle_files/promcode-shapes.ttl, with 0 issues (0 info, 0 warnings, 0 errors)

Warning: This vocabulary was given, but not referenced in the given shapes:
file:/Users/tomkamimura/PROMCODE/oslc-promcode/PROMCODE/turtle_files/promcode-vocab.ttl

@berezovskyi
Copy link
Member Author

I have checked the files from my side, here is the output:

❯ ./scripts/check-promcode.sh
Results from ShapeChecker run on Thu Mar 10 16:27:28 CET 2022

Command line arguments:
-t Warning -C -q EmbeddedWhitespace -q MissingPeriod -x http://open-services.net/ns/promcode -x
http://open-services.net/ns/promcode#.* -x http://purl.org/dc/terms/ -x http://purl.org/dc/terms/.* -v
/Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-vocab.ttl -s
/Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-shapes.ttl

A total of 1 issue was found (0 info, 1 warnings, 0 errors)

Checked vocabulary http://open-services.net/ns/promcode# from file:/Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-vocab.ttl, with 0 issues (0 info, 0 warnings, 0 errors)

Checked shapes from file:/Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-shapes.ttl, with 0 issues (0 info, 0 warnings, 0 errors)

Warning: This vocabulary was given, but not referenced in the given shapes:
file:/Users/ezandbe/git/a/oslc/websites/open-services/content/ns/promcode/promcode-vocab.ttl

All the other warnings on your side is because your machine does not have proper internet access (proxy needed?).

@tomkamimura
Copy link
Contributor

tomkamimura commented Mar 11, 2022 via email

@berezovskyi
Copy link
Member Author

@ndjc could you please advise on "Warning: This vocabulary was given, but not referenced in the given shapes"? I checked the shapes and they do reference the vocab:

@prefix oslc_promcode: <http://open-services.net/ns/promcode#> .
@prefix : <http://open-services.net/ns/promcode/shapes/1.0#> .

:Measure a oslc:ResourceShape ;
    oslc:describes oslc_promcode:Measure ;

Vocab:

@prefix : <http://open-services.net/ns/promcode#> .

:Measure
	a rdfs:Class ;
	rdfs:isDefinedBy : ;

I see that most scripts have the -q unusedVocabulary flag, which I did not use for this check. Can we safely add that flag and ignore the warning?

@tomkamimura I will open a ballot with the OSLC OP PGB once Nick confirms 👆 and publish the files once the ballot closes (7 days). Thank you for working together with us to get the files in a good shape 😉

@berezovskyi
Copy link
Member Author

@ndjc I know your time is limited now but you are our only hope in understanding why "Warning: This vocabulary was given, but not referenced in the given shapes" pops up 🙏

@tomkamimura Nick has retired and if he doesn't find time to reply soon, I will start the ballot.

@jamsden
Copy link
Member

jamsden commented Mar 17, 2022

I believe that warning is about vocabulary terms, classes or properties that are defined, but don't appear in any oslc:ResourceShape describes or oslc:Property describes property. That's a warning because not all vocabulary terms need to be constrained, but its possible that this indicates something is missing in the shapes, especially if the shapes are being used to essentially define a structured view of the vocabulary.

@berezovskyi
Copy link
Member Author

I see, thanks Jim. I think most of the terms are covered by shapes, so we are good. I will see if I can get more output with more verbose log levels.

@tomkamimura
Copy link
Contributor

We looked at our turtle files and our script to run ShapeCheck. There were some blank characters in places that may have caused a warning. Also, we changed parameters of the script to detect such blank characters. After fixing those blank characters, we ran the script and a warning is now gone. Here is the output of ShapeCheck. So, I think we are good now. I have modified the turtle files in the active PQ. @berezovskyi, will you please move ahead to get an agreement from oslc-ops?

Command line arguments:
-t Warning -C -q unusedVocabulary -x http://open-services.net/ns/promcode -x http://open-services.net/ns/promcode#.* -x
http://purl.org/dc/terms/ -x http://purl.org/dc/terms/.* -v
/Users/tomkamimura/PROMCODE/oslc-promcode/PROMCODE/turtle_files/promcode-vocab.ttl -s
../../../turtle_files/promcode-shapes.ttl

A total of 0 issues were found (0 info, 0 warnings, 0 errors)

Checked vocabulary file:/Users/tomkamimura/PROMCODE/oslc-promcode/PROMCODE/turtle_files/promcode-vocab.ttl from file:/Users/tomkamimura/PROMCODE/oslc-promcode/PROMCODE/turtle_files/promcode-vocab.ttl, with 0 issues (0 info, 0 warnings, 0 errors)

Checked shapes from file:/Users/tomkamimura/PROMCODE/oslc-promcode/PROMCODE/build/install/ShapeChecker/../../../turtle_files/promcode-shapes.ttl, with 0 issues (0 info, 0 warnings, 0 errors)

@tomkamimura
Copy link
Contributor

One more comment. We double checked our turtle files and confirmed the all the terms defined in vocab.ttl are referenced in shapes.ttl. You might think that a warning is gone because we added the parameter -q unusedVocabulary. We tested turtle files of QM that does not produce any warning. The script of Qm uses this parameter also. But, when we removed this parameter in the script of QM, it produced the same warning as the one we used to get. So, I don't know what causes a warning when the parameter unusedVocabulary is not used. At least, we can say that if there is a problem, QM probably has the same problem. In any case, the warning message produced by ShapeCheck does not seem accurate.

@tomkamimura
Copy link
Contributor

tomkamimura commented Mar 24, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants