URL address of the page where you encountered the problem
No public URL is available. I identified the problem on a fresh local Skosmos v3.4 container instance.
Description of the problem
While creating a fresh thesaurus using OWL, I noticed that adding a language code to owl:versionInfo causes PHP warnings.
Steps to reproduce
- Load a vocabulary containing:
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
<https://example.org/thesaurus> a owl:Ontology, skos:ConceptScheme;
skos:prefLabel "Test thesaurus"@en;
owl:versionInfo "5"@en .
- Open the vocabulary page.
The page displays:
Warning: Undefined array key 0 in /var/www/html/src/model/Vocabulary.php on line 225
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/html/src/model/Vocabulary.php on line 326
Expected outcome
The version information displays without PHP warnings.
Additional information (e.g. screenshots) about the problem
Tested with Skosmos container using v3.4 and PHP 8.3.
Tracing the issue shows that Skosmos stores the literal value as its array key:
|
$ret[$prop][$val->getValue()] = $val; |
In the example I showed it would create [5 => $val], but the code later assumes that it is stored as key 0:
|
if (isset($ret['owl:versionInfo'])) { // if version info available for vocabulary convert it to a more readable format |
|
$ret['owl:versionInfo'][0] = $this->parseVersionInfo($ret['owl:versionInfo'][0]); |
|
} |
OWL supports literal values on annotation properties. So while little value might be gained from a language code it still is valid OWL.
The browser you used when the problem appeared
Not browser-specific. The same warnings are reproducible using curl.
URL address of the page where you encountered the problem
No public URL is available. I identified the problem on a fresh local Skosmos v3.4 container instance.
Description of the problem
While creating a fresh thesaurus using OWL, I noticed that adding a language code to
owl:versionInfocauses PHP warnings.Steps to reproduce
The page displays:
Expected outcome
The version information displays without PHP warnings.
Additional information (e.g. screenshots) about the problem
Tested with Skosmos container using v3.4 and PHP 8.3.
Tracing the issue shows that Skosmos stores the literal value as its array key:
Skosmos/src/model/Vocabulary.php
Line 196 in b0367e2
In the example I showed it would create
[5 => $val], but the code later assumes that it is stored as key0:Skosmos/src/model/Vocabulary.php
Lines 224 to 226 in b0367e2
OWL supports literal values on annotation properties. So while little value might be gained from a language code it still is valid OWL.
The browser you used when the problem appeared
Not browser-specific. The same warnings are reproducible using curl.