Difficult to determine enumeration types from generated OWL/SHACL file
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia esaminando il flusso di generazione di spec-parser e gli esempi OWL/SHACL nell’issue, in particolare la classe HashAlgorithm e la restrizione della proprietà Hash. Determina come debba essere rappresentato un marker di enum a livello di classe e come il codice Java generato possa utilizzarlo; il lavoro è completo quando le classi enum possono essere identificate senza euristiche basate sui riferimenti alle proprietà.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context: to generate the Java code from the OWL/SHACL file, we need to determine if a particular class is an enumeration type
Based on the information available in the OWL/SHACL file, we would have to find all property references to the class and do some rather messy heuristics to determine if a particular class is an Enum class.
Suggestion is to add some information at the class level to more accurately and easily determine if a class represents an Enum with a limited range of values.
Currently, it looks like the only hints as to whether a class is an Enum class is in the properties whose range is that class.
Details:
The current generated file only has basic information for a class containing only enumerated values. For example, HashAlgorithm is defined only containing the comment:
ns2:HashAlgorithm a owl:Class ;
rdfs:comment "A mathematical algorithm that maps data of arbitrary size to a bit string."@en .
The individuals defined for that class can be a hint, but they only have a label and a comment. Example:
<https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/adler32> a owl:NamedIndividual,
ns2:HashAlgorithm ;
rdfs:label "adler32" ;
rdfs:comment "Adler-32 checksum is part of the widely used zlib compression library as defined in [RFC 1950](https://datatracker.ietf.org/doc/rfc1950/) Section 2.3."@en .
The properties which are limited to the class do provide a restriction which can be useful.
Example:
ns2:Hash a owl:Class,
sh:NodeShape ;
rdfs:comment "A mathematically calculated representation of a grouping of data."@en ;
rdfs:subClassOf ns2:IntegrityMethod ;
sh:nodeKind sh:BlankNode ;
sh:property [ sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:nodeKind sh:Literal ;
sh:path ns2:hashValue ],
[ sh:class ns2:HashAlgorithm ;
sh:in ( <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/adler32> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/blake2b256> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/blake2b384> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/blake2b512> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/blake3> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/crystalsDilithium> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/crystalsKyber> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/falcon> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/md2> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/md4> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/md5> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/md6> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/other> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha1> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha224> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha256> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha384> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha512> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha3_224> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha3_256> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha3_384> <https://spdx.org/rdf/3.0.1/terms/Core/HashAlgorithm/sha3_512> ) ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:nodeKind sh:IRI ;
sh:path ns2:algorithm ] .
- Lingua principale
- Python
- Stelle
- 11
- Fork
- 13
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di spdx/spec-parser
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 45/100
spdx/spec-parser#218 ·
-
Question: where do I find the SPDX spec version in the generated model file?Forse di nuovo libera @zvr l’ha presa 118 giorni fa e non c’è nessuna pull request aperta. Aperta
spdx/spec-parser#214 · 7 commenti · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
spdx/spec-parser#207 · 1 reazione ·
-
Context file: Set @type to @id for terms that refer to a classForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
spdx/spec-parser#204 ·
-
Determine actual base URI from the modelForse già presa @bact l’ha presa 309 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
spdx/spec-parser#203 ·
Tutte le issue di spdx/spec-parser
Issue simili
-
[Bug]: test_remote_realpath_uses_argument_vector fails on Windows with Python 3.13+ (ntpath.isabs)Forse già presa @gouyu-hou l’ha presa oggi. Apertatriage/confirmed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
agentscope-ai/agentscope#4397 ·
I maintainer di solito rispondono entro 2 giorni
-
area/profiles area/sessions comp/desktop desktop/chat desktop/sessions P2 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NousResearch/hermes-agent#161712 ·
I maintainer di solito rispondono entro 1 giorno
-
[New Check]: postgresql_flexible_server_public_network_access_disabledForse già presa @pouria-l l’ha presa oggi. Apertafeature-request status/needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
prowler-cloud/prowler#13615 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
SACGF/variantgrid#2941 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
linkedin/Liger-Kernel#1730 ·
I maintainer di solito rispondono entro 3 giorni