Conversation
Find terms without an example in examples directory Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
|
This is cool, I'll run it on 2.2 later. I think this is taking all the RDF outputs and checking which terms occur (anywhere) in examples? We also have the Examples CSV/RDF which contains Line 51 in 5f2f7e9 dct:subject of examples and then ensure that there is an example for the concept (ideal) or parent (rdf:type)?
|
|
We can use #12 for the general discussion on what to use for example / use-case and how to script tests around it. |
Yes. Since the TTLs in examples/ directory are not in full form, I just match terms with a regular expression (without actual Turtle/RDF parsing). Will put this in code comment. I will check the |
|
What do you mean by full form? They should be valid as turtle - except the name spaces which are taken from the csvs. |
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Sorry. I should use another word. |
|
I see. It's possible to make them fully conformant turtle files. My worry was that this might take up too much space in the html, but I can truncate the namespaces there via code. Please open an issue for this and I'll implement it later. Though do we need this for v2.2 or can it be done for v2.3? I prefer later as this might break stuff. |
|
I prefer 2.3. No rush since it will take more time to actually have more examples anyway. |
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
|
The code is updated to cover a case like in #371. This is what it reports from 2.2 draft: Note that not all of them are actually undefined. Few may be just a typo or some can be intentional or they are just come from another vocabulary (e.g., odrl).
|
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
|
Thanks @bact -- looking super helpful. For undefined terms in examples #358 (comment) -- these should be fixed, yes? Same issue as #371? |
|
I think so. Mind that some of them are false positives, due to limitations of regex matching. For example, "policy:1" is from |
|
Thanks, I'll change what I can find from these. There is code somewhere in the existing setup that distinguishes between "DPV concepts" and others based on namespaces in order to generate RDF or HTML. Later when looking at this, I'll see how to use that here as then we won't have to rely on regex and broken/invalid RDF will also be flagged automatically. |
|
I can take some of these. |
|
I will move the unresolved ones to #372 to better track that. Update: Done. All remaining undefined terms are here: #372 (comment) |
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
|
Tested this for fixing typos, brilliant stuff @bact - very helpful! Some minor issues which are easily recognised and ignored: |
|
The numbering of the script (2xx) is a bit confusing though since there is one part (the check of possible undefined terms in HTML) that should be run after the HTML generation script (300). Can think more about this for 2.3. |
|
@bact How about -- we make all |
|
What about
But this will make the possible numbers for each category limited to only 9 and difficult to allocate in a forward-compatible way (keep same numbers in the future). |
|
Isn't the issue here that the script tests both RDF and HTML -- and then whether it should be |
|
You're right. Keep it 4xx simple. Thanks. |
Do not match strings (surrounded with quotes) and datetime-lookalike Co-Authored-By: Harshvardhan Pandit <me@harshp.com>
Fixed the regex as suggested. Run against the latest code in
|
|
Run against 2.3-dev on 2026-02-04 11:15 UTC |
|
brilliant work, thanks @bact -- I'd like to have this integrated into dev from the start for |
Pull Request
From DPV 2.3, new concepts should have an example (see 13 Aug 2025 meeting).
This
295_find_terms_without_example.pyscript will find terms without an example in theexamplesdirectory.Update: The script will also find terms used in an example but undefined in vocab files (a potential typo).
Running without option at command line, it will show numbers of terms with an example (or that one of their parents has an example):
Running with
-voption, it will print all the terms without an example:Not exactly useful yet since it can't distinguished the new terms (from one version to another).
Eventually, once we have a "sinceVersion" information (see #359), we may able to show only new terms without an example.