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

Displaying skos notation with a data type and label in the properties on the concept page #1198

Merged

Conversation

miguelvaara
Copy link
Contributor

If a notation is shown in the properties on the concept page, also a datatype and datatype label are shown.

In the vocabulary config:

skosmos:showNotationAsProperty "true"; -> The notation in the properties is shown

skosmos:showNotationAsProperty "false"; -> The notation in the properties is not shown

commented: #skosmos:showNotationAsProperty "true"; -> The notation in the properties is shown

@miguelvaara
Copy link
Contributor Author

miguelvaara commented Sep 8, 2021

If you need test data...

...a datatype and label can be created like this:

PREFIX skos: http://www.w3.org/2004/02/skos/core#
PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#

INSERT DATA
{
GRAPH http://www.yso.fi/onto/juho/
{
http://www.yso.fi/onto/juho/dt1 rdf:type rdfs:Datatype ;
rdfs:label "DataTypeTesting" .
}
}


Adding a notation and datatype:

INSERT DATA
{
GRAPH http://www.yso.fi/onto/juho/
{
http://www.yso.fi/onto/juho/p5436 skos:notation "Notaatiotesraus"^^http://www.yso.fi/onto/juho/dt1 .
}
}

Copy link
Member

@osma osma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave a few suggestions for improvements.

Also, unit tests are failing and that should be investigated. My guess is that this could have been caused by the changes to the SPARQL query, but it's hard to tell and needs to be tested locally.

@miguelvaara miguelvaara linked an issue Sep 9, 2021 that may be closed by this pull request
@miguelvaara miguelvaara changed the title Issue1087 displaying skos notation with data type in UI Displaying skos notation with a data type and label in the properties on the concept page Sep 9, 2021
Copy link
Member

@osma osma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting to look good, I gave a few comments for improvement.

@miguelvaara miguelvaara force-pushed the issue1087-displaying-skos-notation-with-data-type-in-ui branch from 64ee912 to 05c55e3 Compare September 16, 2021 12:16
@codecov
Copy link

codecov bot commented Sep 16, 2021

Codecov Report

Merging #1198 (aff26b4) into master (33a2222) will decrease coverage by 0.10%.
The diff coverage is 47.05%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1198      +/-   ##
============================================
- Coverage     68.26%   68.16%   -0.11%     
- Complexity     1609     1615       +6     
============================================
  Files            32       32              
  Lines          3955     3970      +15     
============================================
+ Hits           2700     2706       +6     
- Misses         1255     1264       +9     
Impacted Files Coverage Δ
model/sparql/GenericSparql.php 92.14% <ø> (ø)
model/ConceptPropertyValueLiteral.php 52.00% <18.18%> (-10.50%) ⬇️
model/Concept.php 81.09% <100.00%> (+0.14%) ⬆️
model/VocabularyConfig.php 93.58% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 33a2222...aff26b4. Read the comment docs.

* Returns the boolean value of the skosmos:showNotationAsProperty setting.
* @return boolean
*/
public function getShowNotationAsProperty()
Copy link
Contributor

@kouralex kouralex Sep 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return type could be added as this is a new function via : bool

@@ -31,6 +34,17 @@ public function getLang()
return $this->literal->getLang();
}

public function getDatatype()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring + return type missing

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 6 Security Hotspots
Code Smell A 6 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

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

Successfully merging this pull request may close these issues.

Feature request: Displaying skos:notation with data type in UI
3 participants