-
Notifications
You must be signed in to change notification settings - Fork 34
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
Generate types for external schema #169
Comments
Hmm. You'll need a few things to do this:
I vaguely remember running into some issues last time I looked at passing the owl definitions because they utilized a richer set of RDF, including anonymous lists, etc, which this parser didn't understand. But I might be mixing this up. Let me know how it goes. You can try to get something locally by converting .tt or JSON-LD schema definitions of both into .nt, saving both to disk and concatenating both files. I'll try to set some time aside in the next few days to reproduce myself. |
When it works, btw, you would see the properties of Product include "gs1:additionalProductDescription" etc |
Thanks for the lead. I have both schema definitions in .nt format (https://github.com/hawyar/gs1.nt). Now using gs1.nt for the Caught Error on end: Error: ParseError: Error: Unexpected URL http://gs1.org/voc/ with no room for 'name'. while parsing line http://gs1.org/voc/,http://purl.org/dc/elements/1.1/description,"The GS1 RDF vocabulary, described using W3C RDF Schema and the Web Ontology Language.".
Original Stack:
Error: Unexpected URL http://gs1.org/voc/ with no room for 'name'.
at Function.Parse (file:///Users/hawyar/Personal/gs1-schema/node_modules/schema-dts-gen/dist/src/triples/types.js:88:19)
at subject (file:///Users/hawyar/Personal/gs1-schema/node_modules/schema-dts-gen/dist/src/triples/reader.js:32:20)
at process (file:///Users/hawyar/Personal/gs1-schema/node_modules/schema-dts-gen/dist/src/triples/reader.js:172:26)
at process.next (<anonymous>)
at IncomingMessage.<anonymous> (file:///Users/hawyar/Personal/gs1-schema/node_modules/schema-dts-gen/dist/src/triples/reader.js:119:28)
at IncomingMessage.emit (node:events:532:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) Is the richer set of RDF in the GS1 schema definition the main issue here? I would be happy to dedicate some time for this. |
I thought a richer set of RDF would be present in OWL (which exercises blank nodes), but in this case it appears that schema-dts might not need to care about this. The parse error here is due to references to In this specific case these are meta-properties that likely won't affect your output TS anyway. Once that is done, you'll still see another issue: gs1 uses |
I'm looking into fixing this, but FWIW gs1's generated schema seems to be invalid. E.g.
So until gs1 fixes their code, you'll always need manual modifications on top of the generated .nt file. |
1. Support URL nodes with no "name" 2. Support URL nodes with search query string 3. Understand native rdfs:domain and rdfs:range directives 4. Do not treat OWL Class/Property & other ontology declarations as enum membership 5. Context support for unnamed URLs ("schema:" is totally valid) 6. Allow type=Class to be transitive 7. Support 1-char long strings This begins building support for google#169
I am having difficulty understating the rdfa and owl class clash here. I can fix the typo in the generated .nt file. Is that why Thank you |
That's likely. And yeah fixing the typo for MeasurementPrecisionCode will help. There are a few others that are also broken. I'll try to regenerate a list.
Can you elaborate? |
No worries, just a knowledge gap on my part. I was trying to understand "We need better awareness that an OWL class behaves the same(ish) as an rdfa class" How did you catch the typo? |
I ran schema-dts-gen 1.1.0 (or the equivalent local version I was using) against the .nt you provided, and every time it complained about an error I noted it |
I also commented on consensusnetworks/healthnet#104 that the context you're using there is not quite right (yet). |
I am trying to generate types for the GS1 web vocabulary. I have included the context used
which results in the correct context
but then I am not sure how to use
I think I am missing something here. Any feedback is appreciated
The text was updated successfully, but these errors were encountered: