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

New configuration file format to replace config.inc #738

Closed
osma opened this issue Mar 12, 2018 · 17 comments
Closed

New configuration file format to replace config.inc #738

osma opened this issue Mar 12, 2018 · 17 comments
Labels
Milestone

Comments

@osma
Copy link
Member

osma commented Mar 12, 2018

At the moment we use a PHP file called global.inc for global configuration settings. Most of them are set using define() statements. But this is not a very flexible format and causes difficulties in unit testing, because while the config.inc is parsed within the GlobalConfig constructor, its effects are global so there cannot be two configurations active within the same PHP environment.

We could introduce a new configuration file format for Skosmos 2.0 since it's a major version bump. There should be some migration mechanism, for example a script that converts an old configuration file to the new format.

Reasonable options for a new configuration file format:

  • PHP .inc file that defines an array with settings
  • YAML

Not so good options:

  • JSON: doesn't support comments
  • INI style: doesn't support arrays
  • XML: nobody wants to use XML...
@osma osma added this to the 2.0 milestone Mar 12, 2018
@kinow
Copy link
Collaborator

kinow commented Mar 12, 2018

I'm used to YAML for several SpringBoot projects, Ansible, some AWS stuff, and even PHP Symfony projects. Happy to use .inc and JSON too.

But what I like the most about YAML are:

i) comments are easy
ii) it's not so hard to create some way to have files that include or inherit from other files. This way you can have something like global.yml with all the options, and a user.yml which overrides/adds options

There're also great libraries for YAML validation such as SnakeYAML and also for search/query like JMESPath (learned it after debugging an issue in aws-cli).

Just my 0.02 cents

@osma
Copy link
Member Author

osma commented Mar 12, 2018

Thanks @kinow for your comments! Now that you mentioned comments, I think that's one good reason to prefer YAML over JSON. So the contenders are PHP .inc and YAML.

@osma
Copy link
Member Author

osma commented Mar 16, 2018

@kinow Any pointers to a YAML based configuration file with an include mechanism?

@kinow
Copy link
Collaborator

kinow commented Mar 20, 2018

I'm more familiar with Laravel, but lately have been learning Symfony at work. So the first one that came to my mind was Symfony YAML configuration: https://symfony.com/doc/current/service_container/import.html

Look at the import key used in their YAML file. I believe the logic behind it is done here https://github.com/symfony/symfony/blob/1fffb8554cf3a3cd1d800e66afbd00e63282123a/src/Symfony/Component/Routing/Loader/YamlFileLoader.php#L147

But shouldn't be very complicated. Here's another example, now a module just for configuration (never used it tho): https://github.com/awurth/PHP-Config

And this package https://packagist.org/packages/pragmarx/yaml has some interesting features that could be handy.

Alas I couldn't find a good library for PHP, generic enough so that it would be easy to integrate into Skosmos. I believe you will have to grab bits and pieces from the PHP Yaml module, plus examples/snippets from some libraries like these with compatible license, and create a Skosmos configuration parser :-/

Hope that helps

@nichtich
Copy link
Contributor

nichtich commented Apr 5, 2018

How about config.ttl? For instance

<> skosmos:SERVICE_NAME "Skosmos" .

I'm a big fan of YAML but Skosmos is configured in Turtle syntax anyway so why add another syntax?

@kinow
Copy link
Collaborator

kinow commented Apr 5, 2018

I'm OK with Turtle too.

but Skosmos is configured in Turtle syntax anyway so why add another syntax?

I believe this is partly right? You have the vocabulary config... but also a config.inc? Which points to the vocab config file location if I remember well...

I think this issue is to replace that other config file. But making everything Turtle could be an intetesting option. I had had to compare JSON, INI, XML, YAML, and other formats. But never compared any of these with Turtle. So definitely interested in what others think about it.

@osma
Copy link
Member Author

osma commented Apr 12, 2018

Great idea @nichtich ! As @kinow said the original idea was to replace the current config.inc. But instead of directly replacing it with another format, we could merge the current config.inc and vocabularies.ttl configuration files into a single Turtle file that defines both the general settings and the vocabularies - a little bit like how Fuseki (especially version 1) is configured.

Then the configuration could also be kept in a triple store, as somebody requested a while ago.

Another idea would be to support owl:imports statements in the file that could be used as an include mechanism, to make it possible to split the configuration into several files or even just URIs/URLs that provide access to the configuration (though some caching mechanism would be necessary in that case, as the configuration is read on every request).

@osma osma added the size-medium 2 hours to 2 days label May 3, 2018
@kinow
Copy link
Collaborator

kinow commented May 24, 2018

I think we still need to define how the configuration will be modelled with turtle then. Maybe something like

@prefix void: <http://rdfs.org/ns/void#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix skosmos: <http://purl.org/net/skosmos#> .
@prefix : <#> .

skosmos:Configuration a rdfs:Class .

:config a skosmos:Configuration ;
	:values
	    [ :name "VOCABULARIES_FILE" ; :value "vocabularies.ttl" ] ,
		[ :name "DEFAULT_ENDPOINT" ; :value "http://localhost:3030/ds/sparql" ] ,
		[ :name "DEFAULT_SPARQL_DIALECT" ; :value "Generic" ] ,
		[ :name "SPARQL_COLLATION_ENABLED" ; :value false ] ,
		[ :name "SPARQL_TIMEOUT" ; :value 20 ] ,
		[ :name "HTTP_TIMEOUT" ; :value 5 ] ,
		[ :name "SERVICE_NAME" ; :value "Skosmos" ] ,
		[ :name "BASE_HREF" ; :value "http://localhost/Skosmos/" ] ,
		[ :name "LANGUAGES" ;
			:values 
				[ :name "fi" ; :value "fi_FI.utf8" ] ,
				[ :name "sv" ; :value "sv_SE.utf8" ] ,
				[ :name "en" ; :value "en_GB.utf8" ]
			;
		] ,
		[ :name "SEARCH_RESULTS_SIZE" ; :value 20 ] ,
		[ :name "DEFAULT_TRANSITIVE_LIMIT" ; :value 1000 ] ,
		[ :name "LOG_CAUGHT_EXCEPTIONS" ; :value true ] ,
		[ :name "LOG_BROWSER_CONSOLE" ; :value false ] ,
		[ :name "LOG_FILE_NAME" ; :value "" ] ,
		[ :name "TEMPLATE_CACHE" ; :value "/tmp/skosmos-template-cache" ] ,
		[ :name "CUSTOM_CSS" ; :value "resource/css/stylesheet.css" ] ,
		[ :name "FEEDBACK_ADDRESS" ; :value "" ] ,
		[ :name "FEEDBACK_SENDER" ; :value "" ] ,
		[ :name "FEEDBACK_ENVELOPE_SENDER" ; :value "" ] ,
		[ :name "UI_LANGUAGE_DROPDOWN" ; :value false ] ,
		[ :name "UI_HONEYPOT_ENABLED" ; :value true ] ,
		[ :name "UI_HONEYPOT_TIME" ; :value 5 ]
.

Or we could have something like

skosmos:Configuration a rdfs:Class ;
	rdfs:label "A configuration source." ;
	rdfs:comment "All instances will be used for configuration. You are allowed to create multiple instances per logical sections (e.g. UI, System, etc)."
.

skosmos:VocabularyConfiguration a rdfs:Class ;
	rdfs:subClassOf skosmos:Configuration ;
	rdfs:label "The vocabulary configuration location." ;
	rdfs:comment "This file is loaded separately, and in a different manner." 
.

:vocabularyConfiguration a skosmos:VocabularyConfiguration ;
	skosmos:ConfigurationLocation <file://vocabularies.ttl>
.

:skosmosConfig a skosmos:Configuration ;
	skosmos:

...

And try to have subClasses as sections. Which I think would overcomplicate, and possibly reduce performance as PHP would have to re-evaluate it constantly, or cache it.

Not too fluent nor used to model many classes like these, so let me know if it is way off of a possible solution :-) no hard feelings.

Cheers
Bruno

ps: loading the first example, the following query would expand most blank nodes

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skosmos: <http://purl.org/net/skosmos#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX : <http://localhost:3030/ds2/data#> 

CONSTRUCT { ?values ?x ?y . ?values ?key ?value }
WHERE {
  ?x a skosmos:Configuration .
  ?x :values ?values .
  OPTIONAL {
	?values ?key ?value 
  }
}

The languages were actually a variable in the configuration file, holding a PHP array. We can try to expand it too, or just leave it to be done programmatically with EasyRDF...

@kinow
Copy link
Collaborator

kinow commented May 24, 2018

Oh, and not too sure about importing vocabularies.ttl. Easier to see how it would work once the first part which loads the new ttl configuration is done, and then we check whether we are able & it makes sense to load another external file (and perhaps make it so it's generic and we can load others too?), or if maybe we should leave the parsing & the VocabularyConfig object as is.

@osma
Copy link
Member Author

osma commented May 24, 2018

@kinow That's a good start! But I think it can be simplified.

First of all let's think of the whole Skosmos configuration (global + vocabularies) as a single RDF graph. We can later think about using owl:imports or some other mechanism to construct that graph from multiple files (or URLs) if necessary, but let's put that aside for a moment and assume it's just a single file with a well-known file name, say config.ttl. This means that the VOCABULARIES_FILE setting can be dropped.

For the other settings, most of them are just a single value, so the blank node with :name and :value indirection is not needed. Instead we could coin new properties for each setting, e.g. skosmos:defaultEndpoint and skosmos:serviceName.

There could be two RDFS/OWL classes, let's say skosmos:Configuration and skosmos:Vocabulary. The latter one already exists (note that there is currently no ontology that actually defines the skosmos: namespace, just conventions and documentation in the wiki).

@kinow
Copy link
Collaborator

kinow commented May 26, 2018

@osma

So something more like this?

@prefix void: <http://rdfs.org/ns/void#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix wv: <http://vocab.org/waiver/terms/norms> .        
@prefix sd: <http://www.w3.org/ns/sparql-service-description#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix skosmos: <http://purl.org/net/skosmos#> .
@prefix isothes: <http://purl.org/iso25964/skos-thes#> .
@prefix mdrtype: <http://publications.europa.eu/resource/authority/dataset-type/> .
@prefix : <#> .

# Skosmos main configuration

:fi a rdfs:Class ;
	:name "fi" ;
	:value "fi_FI.utf8"
.
:sv a rdfs:Class ;
	:name "sv" ;
	:value "sv_SE.utf8"
.
:en a rdfs:Class ;
	:name "en" ;
	:value "en_GB.utf8"
. 

:config a skosmos:Configuration ;
	skosmos:sparqlEndpoint "http://localhost:3030/ds/sparql" ;
	skosmos:sparqlDialect "Generic" ;
	skosmos:sparqlCollationEnabled true ;
	skosmos:sparqlTimeout 20 ;
	skosmos:httpTimeout 20 ;
	skosmos:serviceName "Skosmos" ;
	skosmos:baseHref "http://localhost/Skosmos/" ;
	skosmos:languages ( :fi :sv :en ) ;
	skosmos:searchResultsSize 20 ;
	skosmos:transitiveLimit 1000 ;
	skosmos:logCaughtExceptions true ;
	skosmos:logBrowserConsole false ;
	skosmos:logFileName "" ;
	skosmos:templateCache "/tmp/skosmos-template-cache" ;
	skosmos:customCss "resource/css/stylesheet.css" ;
	skosmos:feedbackAddress "" ;
	skosmos:feedbackSender "" ;
	skosmos:feedbackEnvelopeSender "" ;
	skosmos:uiLanguageDropdown false ;
	skosmos:uiHoneypotEnabled true ;
	skosmos:uiHoneypotTime 5
.

# Skosmos vocabularies

:ysa a skosmos:Vocabulary, void:Dataset ;
	dc:title "YSA - Yleinen suomalainen asiasanasto"@fi,
		"YSA - Allmän tesaurus på finska"@sv,
		"YSA - General Finnish thesaurus"@en ;
	dc:subject :cat_general ;
        dc:type mdrtype:THESAURUS ;
	void:uriSpace "http://www.yso.fi/onto/ysa/";
	skosmos:groupClass skos:Collection;
	skosmos:language "fi";
	skosmos:shortName "YSA";
  	skosmos:feedbackRecipient "vesa-posti@helsinki.fi" ;
	skosmos:showChangeList "true" ;
	void:dataDump <http://api.finto.fi/download/ysa/ysa-skos.ttl> ;
	void:sparqlEndpoint <http://api.dev.finto.fi/sparql> ;
	skosmos:sparqlGraph <http://www.yso.fi/onto/ysa/>
.

:categories a skos:ConceptScheme;
	skos:prefLabel "Skosmos Vocabulary Categories"@en
.

:cat_general a skos:Concept ;
	skos:topConceptOf :categories ;
	skos:inScheme :categories ;
	skos:prefLabel "Yleiskäsitteet"@fi, 
		"Allmänna begrepp"@sv,
		"General concepts"@en
.

mdrtype:THESAURUS a skos:Concept ;
	skos:prefLabel "Тезаурус"@bg, "Tezaurus"@cs, "Tesaurus"@da, "Thesaurus"@de, "Θησαυρός"@el, "Thesaurus"@en, "Tesaurus"@et, "Tesaurus"@fi, "Thésaurus"@fr, "Pojmovnik"@hr, "Tezaurusz"@hu, "Tesauro"@it, "Tēzaurs"@lv, "Tezauras"@lt, "Teżawru"@mt, "Thesaurus"@nl, "Tesaurus"@no, "Tezaurus"@pl, "Tesauro"@pt, "Tezaur"@ro, "Synonymický slovník"@sk, "Tezaver"@sl, "Tesauro"@es, "Tesaurus"@sv
.

mdrtype:ONTOLOGY a skos:Concept ;
	skos:prefLabel "Онтология"@bg, "Ontologie"@cs, "Ontologi"@da, "Ontologie"@de, "Οντολογία"@el, "Ontology"@en, "Ontoloogia"@et, "Ontologia"@fi, "Ontologie"@fr, "Ontologija"@hr, "Ontológia"@hu, "Ontologia"@it, "Ontoloģija"@lv, "Ontologija"@lt, "Ontoloġija"@mt, "Ontologie"@nl, "Ontologi"@no, "Struktura pojęciowa"@pl, "Ontologia"@pt, "Ontologie"@ro, "Ontológia"@sk, "Ontologija"@sl, "Ontología"@es, "Ontologi"@sv
.

@osma
Copy link
Member Author

osma commented May 27, 2018

@kinow Exactly!

For the languages the order is significant so they should probably be expressed as a list. Other than that, looks good! And there are defaults for almost everything so real configurations don't need to be that verbose.

@nichtich Is this what you had in mind?

@kinow
Copy link
Collaborator

kinow commented May 29, 2018

@osma updated the query... not so familiar with lists/collections in RDF/Turtle, so hopefully this version would return the languages in order?

Will wait a bit more to see what @nichtich thinks about it before starting to code. 🎉

By the way, in the beginning I wasn't sure how it would look... but now after looking at this version, and comparing with what I had in mind for YAML... I think I prefer this version :-)

@osma
Copy link
Member Author

osma commented May 29, 2018

@kinow Actually EasyRdf doesn't contain a SPARQL engine, so if the configuration is stored in a file that's parsed by EasyRdf, the graph has to be navigated using the EasyRdf API, not SPARQL. VocabularyConfig already does that for vocabularies defined in vocabularies.ttl, the code in GlobalConfig that currently looks at PHP constants (except for the languages which are in a global variable) would need to be replaced with something similar that uses EasyRdf to read parts of the graph.

@kinow
Copy link
Collaborator

kinow commented May 30, 2018

@osma that's what I had in mind too. My initial idea is to modify GlobalConfig.php, keeping all methods, but changing the constructor to handle a ... Resource? Still need to study the EasyRDF API and understand its objects relations to RDF.

Keeping the GlobalConfig object and its methods, I think the impact in the rest of the code would be minimum. Still need to consider whether the GlobalConfig object will parse/load the vocabularies, or if that'll be kept in the Model object.

Horrible weather here, and Queen's Birthday holiday next Monday. Might spend most of the time this coming long weekend having fun with Skosmos, RDF, Jena, EasyRDF, etc 🎉

kinow added a commit to kinow/Skosmos that referenced this issue Jun 2, 2018
…files.

The cache that was created in the Model instance, now was moved to the
GlobalConfig, but is still accessed from Model to add entries looked up.

There is no more need of a separate .ttl file for vocabularies, as it is
now part of the configuration file. Old files were removed.

In order to maintain backward compatibility, most methods of GlobalConfig
and of VocabularyConfig were maintained as-is. With internal changes to
re-route requests to the right RDF objects.

Tests were minor updates in tests, but only to replace .inc by .ttl or fix
coverage annotations.
@kinow
Copy link
Collaborator

kinow commented Jun 2, 2018

And now we have some working code to review & discuss ! 🎉

#769

osma pushed a commit that referenced this issue Jun 4, 2018
The cache that was created in the Model instance, now was moved to the
GlobalConfig, but is still accessed from Model to add entries looked up.

There is no more need of a separate .ttl file for vocabularies, as it is
now part of the configuration file. Old files were removed.

In order to maintain backward compatibility, most methods of GlobalConfig
and of VocabularyConfig were maintained as-is. With internal changes to
re-route requests to the right RDF objects.

Tests were minor updates in tests, but only to replace .inc by .ttl or fix
coverage annotations.
@osma
Copy link
Member Author

osma commented Jun 4, 2018

#769 merged and mentioned this on the Upgrading page in the wiki. All done until 2.0 release time.

@osma osma closed this as completed Jun 4, 2018
tfrancart added a commit to tfrancart/Skosmos that referenced this issue Oct 3, 2018
* adding limited support for showing skosxl:prefLabels

* Exploding on whitespace _after_ urldecoding the request parameter value
Use UNION when building SPARQL search conditions on schemes
Added unit test for multiple scheme query
use implode

* Added SPARQL query to query for super properties of a property

* Used graph-agnostic queries through default endpoint to retrieve label
and superproperty of a property.

* Fixed call to Namespace.shorten(). Added types to property declarations
in test files.

* Issue 666 - squash commits (#8)

* Added preferredVocabUri parameter to Model::guessVocabularyFromURI()

* Added preferredVocabUri parameter to Model::guessVocabularyFromURI()

* Comment just to have one additionnal commit

* Compared vocab on IDs rather than URIs

* Add the preferred vocabulary parameter when calling
guessVocabularyFromURI

* Comments

* 1. Ability to fetch and return dct:subject of ConceptSchemes in the list
of Concept schemes.
2. Ability to fetch and return multiple concept schemes for which a
concept is a top concept in the parent hierarchy (new 'tops' key in the
JSON-LD result)

* skos-xl labels should now work

* fixing the preflabel right pad

* fixing the unit tests

* fixing the skosxl qtips not appearing after ajaxing content, related to NatLibFi#533

* removing unused ?member variable, fixes NatLibFi#655

* moving mapping concept notations inside the a element, related to NatLibFi#623

* Read property label from current vocabulary before querying the default
graph

* updating the composer dependencies before 1.10 release

* Look for property label and superproperties in the current EasyRdf Model
rather than making another SPARQL query.

* Use locale-based sort to sort values in concept page

* initializing the superprops variable as an empty array

* pulled files from master

* Issue NatLibFi#665 Remove SERVICE_LOGO old constant and related code

* Add Jena Fuseki to gitignore

* updating composer packages, related to NatLibFi#684

* running travis with php 7.0, related to NatLibFi#684

* migrating to phpunit 6, related to NatLibFi#684

* moving to new codeclimate reporter

* removing copypaste error

* updating the mockery package, related to NatLibFi#684

* moving old dependencies to composer, related to NatLibFi#684

* loading the remaining dependencies that were not managed by composer as a composer package, related to NatLibFi#684

* Fix hard crash on missng skosxl:literalForm

If skosxl:literalForm is missing on a label resource the $label variable remains uninitialzed and causes a hard crash

* finished jsonld augmentation

* cleaned code and added phpdoc

* Implements CBD solution for blank nodes and adds reification nodes

* refactored duplicate code

* adding a configurable property that enables defining a priority for label fallback languages, related to NatLibFi#688

* improving the fallback language order feature, related to NatLibFi#688

* fixing the missing prefLabel language tag when showing a fallback label, related to NatLibFi#688

* adding a few tests for getLanguageOrder(), related to NatLibFi#688

* using the configurable fallback languages for the concept property value labels as well, related to NatLibFi#688

* using the skosmos:feedbackLanguages for the rest api hierarchy fallback, related to NatLibFi#688

* fixing missing lang parameter from a getLanguageOrder-call, related to NatLibFi#688

* code style cleanup: removing trailing whitespaces

* whoops

* Cleaned for PR and made tests

* add build/ directory to .gitignore

* fixes NatLibFi#690

* using the configurable fallback language for the REST API children function as well

* filtering out hiddenLabels always when the concept has been found earlier, related to NatLibFi#690

* fixes NatLibFi#692

* applying a band aid for the broken mobile screen vocabulary info layout, related to NatLibFi#691

* recoded long URIs as shortened versions as requested

* only querying for concept info when the search has found some results, related to NatLibFi#696

* fix NatLibFi#701 updates embedded json-ld data correctly

* add language ordering to passed through variables to javascript

* fixing wrong translations

* using a more specific selector for the sidebar custom scrollbar

* fixing a bug with displaying language codes for fallback labels

* using the configured languages as fallbacks too

* fixing false language tags sometimes appearing with mapping concepts

* Issue NatLibFi#661 add a copy to clipboard button

* Add Dutch translations by @mrvdries and @ismakutl. Fixes NatLibFi#710

* css for the copy button

* fixes hard crash when collection doesnt return a label

* adding a random fallback for the guessLanguage so the negotiator wont crash when the accept header has not been set

* run Travis tests with newer Fuseki 3.6.0

* define Code Climate variable as global, separating it from matrix vars

* Remove support for obsolete APC caching functions. Fixes NatLibFi#728

* Issue NatLibFi#712: display the concepts of the first letter available

* Default to the first letter of the alphabet when no letter is selected. Fixes NatLibFi#712

* Add Dockerfile and a docker-compose to run SKOSMOS with Fuseki

* Add Dockerfile container_name's

* Add volume binding example in comments for Fuseki

* Rename Skosmos docker-compose created container name to skosmos

* Fixes NatLibFi#638

* fix constructor call due to previously done refactoring(?)

* Run Travis tests also under PHP 7.1 and 7.2

* add checks to prevent sizeof() related warnings in PHP 7.2

* fix PHP 7.1+ build test by changing the name for error raised

* Changed test fuseki port to 13030; upgraded test fuseki to 3.7.0; fixed PHP 7.2+ build test

* allow tests to fail on PHP 7.2 due to JsonLD compatibility problems

* expect different exceptions depending on PHP version (7.0 vs 7.1+)

* adjust build matrix: test fuseki SNAPSHOT only on php 7.1, allow failures on 7.2 & fuseki SNAPSHOT

* further adjust build matrix

* specify PHP versions without quotes

* adjust build matrix: only test fuseki SNAPSHOT on php 7.1

* bump Fuseki version to 3.7.0 also on Travis tests

* move notifications to new NatLibFi Slack instance

* Allow request input to be mocked

* Refactor getQueryParamArray to always return array

* Add additional fields to JSON-LD context for search endpoint

If additional fields are requested using the 'fields' parameter,
add them to the JSON-LD context.

Note: This will break any implementation that relies on the 'skos:'
prefix being part of the keys.

* Add mapping relations to JSON-LD context

* Add unit test for NatLibFi#744 / PR NatLibFi#756. Fixes NatLibFi#744

* Open all hierarchies when a concept is in multiple schemes. Fixes NatLibFi#765

* fix layout issue due to having a <p> element instead of <span> in skosxl display

* Change feedback message headers to use Reply-To and make name and e-mail optional. Fixes NatLibFi#761

* Set the feedback email sender address properly when a vocabulary-specific recipient has been set. Fixes NatLibFi#761

* Add Arabic translation from Transifex. Fixes NatLibFi#767

* Fix Dockerfile by automatically answering yes to apt-get install locales

* Issue NatLibFi#738 replace .inc configuration files by .ttl (turtle) files.

The cache that was created in the Model instance, now was moved to the
GlobalConfig, but is still accessed from Model to add entries looked up.

There is no more need of a separate .ttl file for vocabularies, as it is
now part of the configuration file. Old files were removed.

In order to maintain backward compatibility, most methods of GlobalConfig
and of VocabularyConfig were maintained as-is. With internal changes to
re-route requests to the right RDF objects.

Tests were minor updates in tests, but only to replace .inc by .ttl or fix
coverage annotations.

* Fix scrutinizer issues

* Remove unused graph variable from Model

* Use a list for skosmos:languages

* add skosmos:globalPlugins example which was forgotten in PR NatLibFi#769

* Use RDFS properties for language settings. Fixes NatLibFi#772

* Fix test config for NatLibFi#772

* Replace PHP explode function call by a Turtle list for globalPlugins

* Include unit test for new globalPlugins with list, and update distributed configuration file

* Issue NatLibFi#771 config migrate tool

* Replace exit() by exceptions, and fail earlier if invalid mode

* Leave values not defined as comments

* Fix search with double quotes

* Upgrade Travis config to use newest Fuseki 3.8.0

* Use Fuseki 3.8.0 by default for tests

* fix getVersion when on a branch with no tags available in recent history

* use the dev.finto.fi SPARQL endpoint as default endpoint, to match vocab config

* Disable Travis tests for Fuseki snapshot. There is no longer a Fuseki1 distribution snapshot we could use, after building it was disabled in JENA-1573.

* updated German translations. Credit: Jonas Waeber

* updated French translations. Credit: Thomas Francart

* updated Polish translations. Credit: Łukasz Szeremeta

* update translation files to match latest template; no actual changes in translations

* Add translations for Farsi, by Omid Ghiasvand and Reza Ghiasvand. Still missing true RTL support (NatLibFi#768)

* fixes NatLibFi#714

* sorting concept property values with natural case sort when sortByNotation is true, fixes NatLibFi#737

* Fixed the variable name notsort for a clearer sort_by_notation

* Avoid double encoding of search query string. Fixes NatLibFi#763

* fix issue regarding updating the json-ld data

* Specify skosmos:defaultEndpoint as a resource, not literal. Fixes NatLibFi#786

* updated German translations for 100% coverage. Credit: Jonas Waeber

* Fix PHP syntax when calling a method

* Set a value for variable when declaring it

* Avoid type coercion in JS when comparing values

* Avoid declaring a variable twice

* Remove unused variable

* Remove duplicated semicolon

* Add Vagrantfile and Ansible Playbook setup for deploying and running Skosmos in virtual environment

* Add .vagrant and .DS_Store to .gitignore

* Remove unnecessary installation of Python 2.7 and configure to use python3

* Removed old config files and added references to eclipse project file to .gitignore

* Remove Fuseki deployment

* Fix apt not installing php-mbstring by updating cache before apt install

* Turn off verbose/debug mode for Ansible provisioner

* Delete .DS_Store

* Delete second .DS_Store

* Remove unnecessary, duplicate configuration file

* Add Vagrantfile and Ansible Playbook setup for deploying and running Skosmos in virtual environment

* Add .vagrant and .DS_Store to .gitignore

* Remove unnecessary installation of Python 2.7 and configure to use python3

* Removed old config files and added references to eclipse project file to .gitignore

* Remove Fuseki deployment

* Fix apt not installing php-mbstring by updating cache before apt install

* Turn off verbose/debug mode for Ansible provisioner

* Delete .DS_Store

* Delete second .DS_Store

* Remove unnecessary, duplicate configuration file

* reorder .gitignore

* Use correct value when retrieving settings

* Add tests for GlobalConfig

* Add more tests for VoacabularyConfig

* Use array in the test for GlobalConfig::getGlobalPlugins

* Fix parameter order for jena-text queries - MAX_N setting was being ignored. Fixes NatLibFi#794

* Loosen the check for port numbers in guessBaseHref. Fixes NatLibFi#796

* removed references to old configuration files
tfrancart added a commit to tfrancart/Skosmos that referenced this issue Nov 22, 2018
* adding limited support for showing skosxl:prefLabels

* Added SPARQL query to query for super properties of a property

* Used graph-agnostic queries through default endpoint to retrieve label
and superproperty of a property.

* Fixed call to Namespace.shorten(). Added types to property declarations
in test files.

* Issue 666 - squash commits (#8)

* Added preferredVocabUri parameter to Model::guessVocabularyFromURI()

* Added preferredVocabUri parameter to Model::guessVocabularyFromURI()

* Comment just to have one additionnal commit

* Compared vocab on IDs rather than URIs

* Add the preferred vocabulary parameter when calling
guessVocabularyFromURI

* Comments

* 1. Ability to fetch and return dct:subject of ConceptSchemes in the list
of Concept schemes.
2. Ability to fetch and return multiple concept schemes for which a
concept is a top concept in the parent hierarchy (new 'tops' key in the
JSON-LD result)

* skos-xl labels should now work

* fixing the preflabel right pad

* fixing the unit tests

* fixing the skosxl qtips not appearing after ajaxing content, related to NatLibFi#533

* removing unused ?member variable, fixes NatLibFi#655

* moving mapping concept notations inside the a element, related to NatLibFi#623

* Read property label from current vocabulary before querying the default
graph

* updating the composer dependencies before 1.10 release

* Look for property label and superproperties in the current EasyRdf Model
rather than making another SPARQL query.

* Use locale-based sort to sort values in concept page

* initializing the superprops variable as an empty array

* pulled files from master

* Issue NatLibFi#665 Remove SERVICE_LOGO old constant and related code

* Add Jena Fuseki to gitignore

* updating composer packages, related to NatLibFi#684

* running travis with php 7.0, related to NatLibFi#684

* migrating to phpunit 6, related to NatLibFi#684

* moving to new codeclimate reporter

* removing copypaste error

* updating the mockery package, related to NatLibFi#684

* moving old dependencies to composer, related to NatLibFi#684

* loading the remaining dependencies that were not managed by composer as a composer package, related to NatLibFi#684

* Fix hard crash on missng skosxl:literalForm

If skosxl:literalForm is missing on a label resource the $label variable remains uninitialzed and causes a hard crash

* finished jsonld augmentation

* cleaned code and added phpdoc

* Implements CBD solution for blank nodes and adds reification nodes

* refactored duplicate code

* adding a configurable property that enables defining a priority for label fallback languages, related to NatLibFi#688

* improving the fallback language order feature, related to NatLibFi#688

* fixing the missing prefLabel language tag when showing a fallback label, related to NatLibFi#688

* adding a few tests for getLanguageOrder(), related to NatLibFi#688

* using the configurable fallback languages for the concept property value labels as well, related to NatLibFi#688

* using the skosmos:feedbackLanguages for the rest api hierarchy fallback, related to NatLibFi#688

* fixing missing lang parameter from a getLanguageOrder-call, related to NatLibFi#688

* code style cleanup: removing trailing whitespaces

* whoops

* Cleaned for PR and made tests

* add build/ directory to .gitignore

* fixes NatLibFi#690

* using the configurable fallback language for the REST API children function as well

* filtering out hiddenLabels always when the concept has been found earlier, related to NatLibFi#690

* fixes NatLibFi#692

* applying a band aid for the broken mobile screen vocabulary info layout, related to NatLibFi#691

* recoded long URIs as shortened versions as requested

* only querying for concept info when the search has found some results, related to NatLibFi#696

* fix NatLibFi#701 updates embedded json-ld data correctly

* add language ordering to passed through variables to javascript

* fixing wrong translations

* using a more specific selector for the sidebar custom scrollbar

* fixing a bug with displaying language codes for fallback labels

* using the configured languages as fallbacks too

* fixing false language tags sometimes appearing with mapping concepts

* Issue NatLibFi#661 add a copy to clipboard button

* Add Dutch translations by @mrvdries and @ismakutl. Fixes NatLibFi#710

* css for the copy button

* fixes hard crash when collection doesnt return a label

* adding a random fallback for the guessLanguage so the negotiator wont crash when the accept header has not been set

* run Travis tests with newer Fuseki 3.6.0

* define Code Climate variable as global, separating it from matrix vars

* Remove support for obsolete APC caching functions. Fixes NatLibFi#728

* Issue NatLibFi#712: display the concepts of the first letter available

* Default to the first letter of the alphabet when no letter is selected. Fixes NatLibFi#712

* Add Dockerfile and a docker-compose to run SKOSMOS with Fuseki

* Add Dockerfile container_name's

* Add volume binding example in comments for Fuseki

* Rename Skosmos docker-compose created container name to skosmos

* Fixes NatLibFi#638

* fix constructor call due to previously done refactoring(?)

* Run Travis tests also under PHP 7.1 and 7.2

* add checks to prevent sizeof() related warnings in PHP 7.2

* fix PHP 7.1+ build test by changing the name for error raised

* Changed test fuseki port to 13030; upgraded test fuseki to 3.7.0; fixed PHP 7.2+ build test

* allow tests to fail on PHP 7.2 due to JsonLD compatibility problems

* expect different exceptions depending on PHP version (7.0 vs 7.1+)

* adjust build matrix: test fuseki SNAPSHOT only on php 7.1, allow failures on 7.2 & fuseki SNAPSHOT

* further adjust build matrix

* specify PHP versions without quotes

* adjust build matrix: only test fuseki SNAPSHOT on php 7.1

* bump Fuseki version to 3.7.0 also on Travis tests

* move notifications to new NatLibFi Slack instance

* Allow request input to be mocked

* Refactor getQueryParamArray to always return array

* Add additional fields to JSON-LD context for search endpoint

If additional fields are requested using the 'fields' parameter,
add them to the JSON-LD context.

Note: This will break any implementation that relies on the 'skos:'
prefix being part of the keys.

* Add mapping relations to JSON-LD context

* Add unit test for NatLibFi#744 / PR NatLibFi#756. Fixes NatLibFi#744

* Open all hierarchies when a concept is in multiple schemes. Fixes NatLibFi#765

* fix layout issue due to having a <p> element instead of <span> in skosxl display

* Change feedback message headers to use Reply-To and make name and e-mail optional. Fixes NatLibFi#761

* Set the feedback email sender address properly when a vocabulary-specific recipient has been set. Fixes NatLibFi#761

* Add Arabic translation from Transifex. Fixes NatLibFi#767

* Fix Dockerfile by automatically answering yes to apt-get install locales

* Issue NatLibFi#738 replace .inc configuration files by .ttl (turtle) files.

The cache that was created in the Model instance, now was moved to the
GlobalConfig, but is still accessed from Model to add entries looked up.

There is no more need of a separate .ttl file for vocabularies, as it is
now part of the configuration file. Old files were removed.

In order to maintain backward compatibility, most methods of GlobalConfig
and of VocabularyConfig were maintained as-is. With internal changes to
re-route requests to the right RDF objects.

Tests were minor updates in tests, but only to replace .inc by .ttl or fix
coverage annotations.

* Fix scrutinizer issues

* Remove unused graph variable from Model

* Use a list for skosmos:languages

* add skosmos:globalPlugins example which was forgotten in PR NatLibFi#769

* Use RDFS properties for language settings. Fixes NatLibFi#772

* Fix test config for NatLibFi#772

* Replace PHP explode function call by a Turtle list for globalPlugins

* Include unit test for new globalPlugins with list, and update distributed configuration file

* Issue NatLibFi#771 config migrate tool

* Replace exit() by exceptions, and fail earlier if invalid mode

* Leave values not defined as comments

* Fix search with double quotes

* Upgrade Travis config to use newest Fuseki 3.8.0

* Use Fuseki 3.8.0 by default for tests

* fix getVersion when on a branch with no tags available in recent history

* use the dev.finto.fi SPARQL endpoint as default endpoint, to match vocab config

* Disable Travis tests for Fuseki snapshot. There is no longer a Fuseki1 distribution snapshot we could use, after building it was disabled in JENA-1573.

* updated German translations. Credit: Jonas Waeber

* updated French translations. Credit: Thomas Francart

* updated Polish translations. Credit: Łukasz Szeremeta

* update translation files to match latest template; no actual changes in translations

* Add translations for Farsi, by Omid Ghiasvand and Reza Ghiasvand. Still missing true RTL support (NatLibFi#768)

* fixes NatLibFi#714

* sorting concept property values with natural case sort when sortByNotation is true, fixes NatLibFi#737

* Fixed the variable name notsort for a clearer sort_by_notation

* Avoid double encoding of search query string. Fixes NatLibFi#763

* fix issue regarding updating the json-ld data

* Specify skosmos:defaultEndpoint as a resource, not literal. Fixes NatLibFi#786

* updated German translations for 100% coverage. Credit: Jonas Waeber

* Fix PHP syntax when calling a method

* Set a value for variable when declaring it

* Avoid type coercion in JS when comparing values

* Avoid declaring a variable twice

* Remove unused variable

* Remove duplicated semicolon

* Add Vagrantfile and Ansible Playbook setup for deploying and running Skosmos in virtual environment

* Add .vagrant and .DS_Store to .gitignore

* Remove unnecessary installation of Python 2.7 and configure to use python3

* Removed old config files and added references to eclipse project file to .gitignore

* Remove Fuseki deployment

* Fix apt not installing php-mbstring by updating cache before apt install

* Turn off verbose/debug mode for Ansible provisioner

* Delete .DS_Store

* Delete second .DS_Store

* Remove unnecessary, duplicate configuration file

* Add Vagrantfile and Ansible Playbook setup for deploying and running Skosmos in virtual environment

* Add .vagrant and .DS_Store to .gitignore

* Remove unnecessary installation of Python 2.7 and configure to use python3

* Removed old config files and added references to eclipse project file to .gitignore

* Remove Fuseki deployment

* Fix apt not installing php-mbstring by updating cache before apt install

* Turn off verbose/debug mode for Ansible provisioner

* Delete .DS_Store

* Delete second .DS_Store

* Remove unnecessary, duplicate configuration file

* reorder .gitignore

* Use correct value when retrieving settings

* Add tests for GlobalConfig

* Add more tests for VoacabularyConfig

* Use array in the test for GlobalConfig::getGlobalPlugins

* Fix parameter order for jena-text queries - MAX_N setting was being ignored. Fixes NatLibFi#794

* Loosen the check for port numbers in guessBaseHref. Fixes NatLibFi#796

* removed references to old configuration files

* Choose feedback recipient based on selection on feedback form, not the URL from which the feedback page was invoked. Fixes NatLibFi#808

* Fix unit test that broke after the fix to NatLibFi#808

(cherry picked from commit 1a55e8b)

* Fix fragile unit test (may break if /tmp/skosmos-template-cache exists but is owned by another user)

* Fix config migration of LOG_FILE_NAME=null

Fixes NatLibFi#801

* fixes NatLibFi#804

* fix some css; addresses issue NatLibFi#799

* #fixes NatLibFi#791; also update fuseki to 3.9.0

* Reenable Fuseki snapshot builds on Travis; use Fuseki2 3.9.0 on Travis instead of 3.8.0

* Don't allow Travis builds with PHP 7.2 to fail; run Fuseki snapshot builds with PHP 7.2. Related to NatLibFi#758

* check which locales are installed in Travis environment

* Try to break unit tests by setting LANGUAGE=fr. Part of NatLibFi#816

* Always set LANGUAGE environment variable when setting LC_ALL. Fixes NatLibFi#816
tfrancart added a commit to tfrancart/Skosmos that referenced this issue Jul 3, 2019
* finished jsonld augmentation

* cleaned code and added phpdoc

* Implements CBD solution for blank nodes and adds reification nodes

* refactored duplicate code

* adding a configurable property that enables defining a priority for label fallback languages, related to NatLibFi#688

* improving the fallback language order feature, related to NatLibFi#688

* fixing the missing prefLabel language tag when showing a fallback label, related to NatLibFi#688

* adding a few tests for getLanguageOrder(), related to NatLibFi#688

* using the configurable fallback languages for the concept property value labels as well, related to NatLibFi#688

* using the skosmos:feedbackLanguages for the rest api hierarchy fallback, related to NatLibFi#688

* fixing missing lang parameter from a getLanguageOrder-call, related to NatLibFi#688

* code style cleanup: removing trailing whitespaces

* whoops

* Cleaned for PR and made tests

* add build/ directory to .gitignore

* fixes NatLibFi#690

* using the configurable fallback language for the REST API children function as well

* filtering out hiddenLabels always when the concept has been found earlier, related to NatLibFi#690

* fixes NatLibFi#692

* applying a band aid for the broken mobile screen vocabulary info layout, related to NatLibFi#691

* recoded long URIs as shortened versions as requested

* only querying for concept info when the search has found some results, related to NatLibFi#696

* fix NatLibFi#701 updates embedded json-ld data correctly

* add language ordering to passed through variables to javascript

* fixing wrong translations

* using a more specific selector for the sidebar custom scrollbar

* fixing a bug with displaying language codes for fallback labels

* using the configured languages as fallbacks too

* fixing false language tags sometimes appearing with mapping concepts

* Issue NatLibFi#661 add a copy to clipboard button

* Add Dutch translations by @mrvdries and @ismakutl. Fixes NatLibFi#710

* css for the copy button

* fixes hard crash when collection doesnt return a label

* adding a random fallback for the guessLanguage so the negotiator wont crash when the accept header has not been set

* run Travis tests with newer Fuseki 3.6.0

* define Code Climate variable as global, separating it from matrix vars

* Remove support for obsolete APC caching functions. Fixes NatLibFi#728

* Issue NatLibFi#712: display the concepts of the first letter available

* Default to the first letter of the alphabet when no letter is selected. Fixes NatLibFi#712

* Add Dockerfile and a docker-compose to run SKOSMOS with Fuseki

* Add Dockerfile container_name's

* Add volume binding example in comments for Fuseki

* Rename Skosmos docker-compose created container name to skosmos

* Fixes NatLibFi#638

* fix constructor call due to previously done refactoring(?)

* Run Travis tests also under PHP 7.1 and 7.2

* add checks to prevent sizeof() related warnings in PHP 7.2

* fix PHP 7.1+ build test by changing the name for error raised

* Changed test fuseki port to 13030; upgraded test fuseki to 3.7.0; fixed PHP 7.2+ build test

* allow tests to fail on PHP 7.2 due to JsonLD compatibility problems

* expect different exceptions depending on PHP version (7.0 vs 7.1+)

* adjust build matrix: test fuseki SNAPSHOT only on php 7.1, allow failures on 7.2 & fuseki SNAPSHOT

* further adjust build matrix

* specify PHP versions without quotes

* adjust build matrix: only test fuseki SNAPSHOT on php 7.1

* bump Fuseki version to 3.7.0 also on Travis tests

* move notifications to new NatLibFi Slack instance

* Allow request input to be mocked

* Refactor getQueryParamArray to always return array

* Add additional fields to JSON-LD context for search endpoint

If additional fields are requested using the 'fields' parameter,
add them to the JSON-LD context.

Note: This will break any implementation that relies on the 'skos:'
prefix being part of the keys.

* Add mapping relations to JSON-LD context

* Add unit test for NatLibFi#744 / PR NatLibFi#756. Fixes NatLibFi#744

* Open all hierarchies when a concept is in multiple schemes. Fixes NatLibFi#765

* fix layout issue due to having a <p> element instead of <span> in skosxl display

* Change feedback message headers to use Reply-To and make name and e-mail optional. Fixes NatLibFi#761

* Set the feedback email sender address properly when a vocabulary-specific recipient has been set. Fixes NatLibFi#761

* Add Arabic translation from Transifex. Fixes NatLibFi#767

* Fix Dockerfile by automatically answering yes to apt-get install locales

* Issue NatLibFi#738 replace .inc configuration files by .ttl (turtle) files.

The cache that was created in the Model instance, now was moved to the
GlobalConfig, but is still accessed from Model to add entries looked up.

There is no more need of a separate .ttl file for vocabularies, as it is
now part of the configuration file. Old files were removed.

In order to maintain backward compatibility, most methods of GlobalConfig
and of VocabularyConfig were maintained as-is. With internal changes to
re-route requests to the right RDF objects.

Tests were minor updates in tests, but only to replace .inc by .ttl or fix
coverage annotations.

* Fix scrutinizer issues

* Remove unused graph variable from Model

* Use a list for skosmos:languages

* add skosmos:globalPlugins example which was forgotten in PR NatLibFi#769

* Use RDFS properties for language settings. Fixes NatLibFi#772

* Fix test config for NatLibFi#772

* Replace PHP explode function call by a Turtle list for globalPlugins

* Include unit test for new globalPlugins with list, and update distributed configuration file

* Issue NatLibFi#771 config migrate tool

* Replace exit() by exceptions, and fail earlier if invalid mode

* Leave values not defined as comments

* Fix search with double quotes

* Upgrade Travis config to use newest Fuseki 3.8.0

* Use Fuseki 3.8.0 by default for tests

* fix getVersion when on a branch with no tags available in recent history

* use the dev.finto.fi SPARQL endpoint as default endpoint, to match vocab config

* Disable Travis tests for Fuseki snapshot. There is no longer a Fuseki1 distribution snapshot we could use, after building it was disabled in JENA-1573.

* updated German translations. Credit: Jonas Waeber

* updated French translations. Credit: Thomas Francart

* updated Polish translations. Credit: Łukasz Szeremeta

* update translation files to match latest template; no actual changes in translations

* Add translations for Farsi, by Omid Ghiasvand and Reza Ghiasvand. Still missing true RTL support (NatLibFi#768)

* fixes NatLibFi#714

* sorting concept property values with natural case sort when sortByNotation is true, fixes NatLibFi#737

* Fixed the variable name notsort for a clearer sort_by_notation

* Avoid double encoding of search query string. Fixes NatLibFi#763

* fix issue regarding updating the json-ld data

* Specify skosmos:defaultEndpoint as a resource, not literal. Fixes NatLibFi#786

* updated German translations for 100% coverage. Credit: Jonas Waeber

* Fix PHP syntax when calling a method

* Set a value for variable when declaring it

* Avoid type coercion in JS when comparing values

* Avoid declaring a variable twice

* Remove unused variable

* Remove duplicated semicolon

* Add Vagrantfile and Ansible Playbook setup for deploying and running Skosmos in virtual environment

* Add .vagrant and .DS_Store to .gitignore

* Remove unnecessary installation of Python 2.7 and configure to use python3

* Removed old config files and added references to eclipse project file to .gitignore

* Remove Fuseki deployment

* Fix apt not installing php-mbstring by updating cache before apt install

* Turn off verbose/debug mode for Ansible provisioner

* Delete .DS_Store

* Delete second .DS_Store

* Remove unnecessary, duplicate configuration file

* Add Vagrantfile and Ansible Playbook setup for deploying and running Skosmos in virtual environment

* Add .vagrant and .DS_Store to .gitignore

* Remove unnecessary installation of Python 2.7 and configure to use python3

* Removed old config files and added references to eclipse project file to .gitignore

* Remove Fuseki deployment

* Fix apt not installing php-mbstring by updating cache before apt install

* Turn off verbose/debug mode for Ansible provisioner

* Delete .DS_Store

* Delete second .DS_Store

* Remove unnecessary, duplicate configuration file

* reorder .gitignore

* Use correct value when retrieving settings

* Add tests for GlobalConfig

* Add more tests for VoacabularyConfig

* Use array in the test for GlobalConfig::getGlobalPlugins

* Fix parameter order for jena-text queries - MAX_N setting was being ignored. Fixes NatLibFi#794

* Loosen the check for port numbers in guessBaseHref. Fixes NatLibFi#796

* removed references to old configuration files

* Choose feedback recipient based on selection on feedback form, not the URL from which the feedback page was invoked. Fixes NatLibFi#808

* Fix unit test that broke after the fix to NatLibFi#808

(cherry picked from commit 1a55e8b)

* Fix fragile unit test (may break if /tmp/skosmos-template-cache exists but is owned by another user)

* Fix config migration of LOG_FILE_NAME=null

Fixes NatLibFi#801

* fixes NatLibFi#804

* fix some css; addresses issue NatLibFi#799

* Added a check for empty arrays to avoid the situation in NatLibFi#813

* #fixes NatLibFi#791; also update fuseki to 3.9.0

* Reenable Fuseki snapshot builds on Travis; use Fuseki2 3.9.0 on Travis instead of 3.8.0

* Don't allow Travis builds with PHP 7.2 to fail; run Fuseki snapshot builds with PHP 7.2. Related to NatLibFi#758

* check which locales are installed in Travis environment

* Try to break unit tests by setting LANGUAGE=fr. Part of NatLibFi#816

* Always set LANGUAGE environment variable when setting LC_ALL. Fixes NatLibFi#816

* update gitignore to match Fuseki2 directory naming (NatLibFi#791)

* Update fi, sv UI translations for skos:relatedMatch. Fixes NatLibFi#707

* support for MARC sources in REST controller

* fix updated, unit tests passed

* Display concept types for search

* Adapt code from concepts page

* Added the new icon and updated tooltip translations

* refactor: rename function for clarity, and make it private since it's only needed internally

* Rewrite concept group handling to take into account multiple hierarchical groups. Fixes NatLibFi#811

* Fix display of array property values

* Use test-specific template cache dir to avoid permission problems. Fixes NatLibFi#821

* updated translations for Finnish, Swedish and German

* Fix case when a concept property value is from another vocabulary. Fixes NatLibFi#819

* Fix concept group display also in search result list. Related to NatLibFi#811

* mark the start of 2.2 development

* Switch from FILTER NOT EXISTS to MINUS to avoid Jena 3.8+ performance issue. Fixes NatLibFi#829

* Also move the VALUES block to avoid Jena 3.8+ performance issues. Fixes NatLibFi#829

* Add phpdocs type hints

* Don't perform label and subPropertyOf lookups for well-known properties. Part of NatLibFi#836

* Support last modified header

* Fix type hints in Model

* Be more lenient with mixed types from EasyRDF

* Add unit test for VocabularyConfig

* Add unit test for Vocabulary

* Add unit test for Concept

* Make unit tests work on both command line and IDE

* Add test data for HTTP 304 RDF tests

* Add unit test for Controller (and include a function to encapsulate header)

* Report coverage for controllers

* Move php built-in functions to other functions, so that we can mock and test everything

* Add unit test for Controller where the 304 response is sent successfully

* Add unit test for WebController

* Update controller/Controller.php

Co-Authored-By: kinow <kinow@users.noreply.github.com>

* Fixed function calls for getLiteral with property and lang

* Added redirection to vocab main page for vocab uri

* Prevent error when the system is configured to use dc:modified, but neither concept nor scheme have dates

* Remove duplicated array index

* Added text to the feedback form in fi, en & sv

* Add REST endpoint for mappings

* Mappings endpoint: Return 404 if concept not found

* Mappings endpoint: Handle case when no label is found

* Mappings endpoint: Fix routing

* Mappings endpoint: Make querying external endpoints optional

* Avoid second unnecessary getProperties call in search result list. Part of NatLibFi#836

* Changed SPARQL query in Count Lang Concepts

Better performance when counting the languages for all concepts by optimizing the SPARQL query

* Avoid unnecessary properties when calling getMappingProperties from search result page. Part of NatLibFi#836

* clean up formatValuesFilterAndBind method

* further simplify generation of languageStatistics query

* Add a cache to avoid computing language order many times during a request

* Added the correct parameters for a constructor call

* Update of Fira Sans embedded fonts with newer version from https://github.com/mozilla/Fira/tree/4.202
- related to bug NatLibFi#855

* Fix methods calls following pull request about concept property mappings

* Get git modified date

* Get config.ttl modified date

* Rename test for getConceptModifiedDate

* Return the most recent date, or null if no date found/retrieved

* Fix data provider name

* Use Model::getConfig() instead of accessing private Model::

* Use a constant of 10 minutes to read configuration for last-modified headers

* Update mocks to expect getConfig called

* Store result of filemtime in GlobalConfig, and re-use in WebController

* Rename constant used only by Git now, and amend comment

* Return a DateTime instead of int in Controller:getIfModifiedSince

* Add missing return statement (used in an empty() function in another part of the code)

* Remove unnecessary variable (it is instantiated in each try/catch block)

* Add missing throws docstring

* Use !== for comparison

* Add missing return statement (returning false as in the other function)

* Turn off mouse events on the dropdown menu

* Rename docker-compose created container from "web" to "skosmos"

There was a note in the Docker installation documentation about renaming it. I'd agree it makes more sense, so prepared this PR.

* Remove playbook.retry file and prevent Ansible from creating one

* Add Fuseki installation and configurations for locally-hosted example data

* Add new line to end of Fuseki config file

* Add config file for using locally-hosted data

* Use a default vocabulary ID when guessing vocabulary, to save lookups. Part of NatLibFi#836

* fix operator that got reverted to != when resolving merge conflict

* Make guessVocabularyFromURI more careful and avoid calling it unless absolutely necessary. Fixes NatLibFi#868

* more elegant way of checking whether a ConceptPropertyValue has a label

* Update README.md

Updated to match current development (delete mention of technologies no longer used)

* upgrading phpunit to 7.5.10 and fixing one test broken by the upgrade

* updating the phpunit configuration file
tfrancart added a commit to tfrancart/Skosmos that referenced this issue Oct 17, 2019
* adding limited support for showing skosxl:prefLabels

* Added SPARQL query to query for super properties of a property

* Used graph-agnostic queries through default endpoint to retrieve label
and superproperty of a property.

* Fixed call to Namespace.shorten(). Added types to property declarations
in test files.

* Issue 666 - squash commits (#8)

* Added preferredVocabUri parameter to Model::guessVocabularyFromURI()

* Added preferredVocabUri parameter to Model::guessVocabularyFromURI()

* Comment just to have one additionnal commit

* Compared vocab on IDs rather than URIs

* Add the preferred vocabulary parameter when calling
guessVocabularyFromURI

* Comments

* 1. Ability to fetch and return dct:subject of ConceptSchemes in the list
of Concept schemes.
2. Ability to fetch and return multiple concept schemes for which a
concept is a top concept in the parent hierarchy (new 'tops' key in the
JSON-LD result)

* skos-xl labels should now work

* fixing the preflabel right pad

* fixing the unit tests

* fixing the skosxl qtips not appearing after ajaxing content, related to NatLibFi#533

* removing unused ?member variable, fixes NatLibFi#655

* moving mapping concept notations inside the a element, related to NatLibFi#623

* Read property label from current vocabulary before querying the default
graph

* updating the composer dependencies before 1.10 release

* Look for property label and superproperties in the current EasyRdf Model
rather than making another SPARQL query.

* Use locale-based sort to sort values in concept page

* initializing the superprops variable as an empty array

* pulled files from master

* Issue NatLibFi#665 Remove SERVICE_LOGO old constant and related code

* Add Jena Fuseki to gitignore

* updating composer packages, related to NatLibFi#684

* running travis with php 7.0, related to NatLibFi#684

* migrating to phpunit 6, related to NatLibFi#684

* moving to new codeclimate reporter

* removing copypaste error

* updating the mockery package, related to NatLibFi#684

* moving old dependencies to composer, related to NatLibFi#684

* loading the remaining dependencies that were not managed by composer as a composer package, related to NatLibFi#684

* Fix hard crash on missng skosxl:literalForm

If skosxl:literalForm is missing on a label resource the $label variable remains uninitialzed and causes a hard crash

* finished jsonld augmentation

* cleaned code and added phpdoc

* Implements CBD solution for blank nodes and adds reification nodes

* refactored duplicate code

* adding a configurable property that enables defining a priority for label fallback languages, related to NatLibFi#688

* improving the fallback language order feature, related to NatLibFi#688

* fixing the missing prefLabel language tag when showing a fallback label, related to NatLibFi#688

* adding a few tests for getLanguageOrder(), related to NatLibFi#688

* using the configurable fallback languages for the concept property value labels as well, related to NatLibFi#688

* using the skosmos:feedbackLanguages for the rest api hierarchy fallback, related to NatLibFi#688

* fixing missing lang parameter from a getLanguageOrder-call, related to NatLibFi#688

* code style cleanup: removing trailing whitespaces

* whoops

* Cleaned for PR and made tests

* add build/ directory to .gitignore

* fixes NatLibFi#690

* using the configurable fallback language for the REST API children function as well

* filtering out hiddenLabels always when the concept has been found earlier, related to NatLibFi#690

* fixes NatLibFi#692

* applying a band aid for the broken mobile screen vocabulary info layout, related to NatLibFi#691

* recoded long URIs as shortened versions as requested

* only querying for concept info when the search has found some results, related to NatLibFi#696

* fix NatLibFi#701 updates embedded json-ld data correctly

* add language ordering to passed through variables to javascript

* fixing wrong translations

* using a more specific selector for the sidebar custom scrollbar

* fixing a bug with displaying language codes for fallback labels

* using the configured languages as fallbacks too

* fixing false language tags sometimes appearing with mapping concepts

* Issue NatLibFi#661 add a copy to clipboard button

* Add Dutch translations by @mrvdries and @ismakutl. Fixes NatLibFi#710

* css for the copy button

* fixes hard crash when collection doesnt return a label

* adding a random fallback for the guessLanguage so the negotiator wont crash when the accept header has not been set

* run Travis tests with newer Fuseki 3.6.0

* define Code Climate variable as global, separating it from matrix vars

* Remove support for obsolete APC caching functions. Fixes NatLibFi#728

* Issue NatLibFi#712: display the concepts of the first letter available

* Default to the first letter of the alphabet when no letter is selected. Fixes NatLibFi#712

* Add Dockerfile and a docker-compose to run SKOSMOS with Fuseki

* Add Dockerfile container_name's

* Add volume binding example in comments for Fuseki

* Rename Skosmos docker-compose created container name to skosmos

* Fixes NatLibFi#638

* fix constructor call due to previously done refactoring(?)

* Run Travis tests also under PHP 7.1 and 7.2

* add checks to prevent sizeof() related warnings in PHP 7.2

* fix PHP 7.1+ build test by changing the name for error raised

* Changed test fuseki port to 13030; upgraded test fuseki to 3.7.0; fixed PHP 7.2+ build test

* allow tests to fail on PHP 7.2 due to JsonLD compatibility problems

* expect different exceptions depending on PHP version (7.0 vs 7.1+)

* adjust build matrix: test fuseki SNAPSHOT only on php 7.1, allow failures on 7.2 & fuseki SNAPSHOT

* further adjust build matrix

* specify PHP versions without quotes

* adjust build matrix: only test fuseki SNAPSHOT on php 7.1

* bump Fuseki version to 3.7.0 also on Travis tests

* move notifications to new NatLibFi Slack instance

* Allow request input to be mocked

* Refactor getQueryParamArray to always return array

* Add additional fields to JSON-LD context for search endpoint

If additional fields are requested using the 'fields' parameter,
add them to the JSON-LD context.

Note: This will break any implementation that relies on the 'skos:'
prefix being part of the keys.

* Add mapping relations to JSON-LD context

* Add unit test for NatLibFi#744 / PR NatLibFi#756. Fixes NatLibFi#744

* Open all hierarchies when a concept is in multiple schemes. Fixes NatLibFi#765

* fix layout issue due to having a <p> element instead of <span> in skosxl display

* Change feedback message headers to use Reply-To and make name and e-mail optional. Fixes NatLibFi#761

* Set the feedback email sender address properly when a vocabulary-specific recipient has been set. Fixes NatLibFi#761

* Add Arabic translation from Transifex. Fixes NatLibFi#767

* Fix Dockerfile by automatically answering yes to apt-get install locales

* Issue NatLibFi#738 replace .inc configuration files by .ttl (turtle) files.

The cache that was created in the Model instance, now was moved to the
GlobalConfig, but is still accessed from Model to add entries looked up.

There is no more need of a separate .ttl file for vocabularies, as it is
now part of the configuration file. Old files were removed.

In order to maintain backward compatibility, most methods of GlobalConfig
and of VocabularyConfig were maintained as-is. With internal changes to
re-route requests to the right RDF objects.

Tests were minor updates in tests, but only to replace .inc by .ttl or fix
coverage annotations.

* Fix scrutinizer issues

* Remove unused graph variable from Model

* Use a list for skosmos:languages

* add skosmos:globalPlugins example which was forgotten in PR NatLibFi#769

* Use RDFS properties for language settings. Fixes NatLibFi#772

* Fix test config for NatLibFi#772

* Replace PHP explode function call by a Turtle list for globalPlugins

* Include unit test for new globalPlugins with list, and update distributed configuration file

* Issue NatLibFi#771 config migrate tool

* Replace exit() by exceptions, and fail earlier if invalid mode

* Leave values not defined as comments

* Fix search with double quotes

* Upgrade Travis config to use newest Fuseki 3.8.0

* Use Fuseki 3.8.0 by default for tests

* fix getVersion when on a branch with no tags available in recent history

* use the dev.finto.fi SPARQL endpoint as default endpoint, to match vocab config

* Disable Travis tests for Fuseki snapshot. There is no longer a Fuseki1 distribution snapshot we could use, after building it was disabled in JENA-1573.

* updated German translations. Credit: Jonas Waeber

* updated French translations. Credit: Thomas Francart

* updated Polish translations. Credit: Łukasz Szeremeta

* update translation files to match latest template; no actual changes in translations

* Add translations for Farsi, by Omid Ghiasvand and Reza Ghiasvand. Still missing true RTL support (NatLibFi#768)

* fixes NatLibFi#714

* sorting concept property values with natural case sort when sortByNotation is true, fixes NatLibFi#737

* Fixed the variable name notsort for a clearer sort_by_notation

* Avoid double encoding of search query string. Fixes NatLibFi#763

* fix issue regarding updating the json-ld data

* Specify skosmos:defaultEndpoint as a resource, not literal. Fixes NatLibFi#786

* updated German translations for 100% coverage. Credit: Jonas Waeber

* Fix PHP syntax when calling a method

* Set a value for variable when declaring it

* Avoid type coercion in JS when comparing values

* Avoid declaring a variable twice

* Remove unused variable

* Remove duplicated semicolon

* Add Vagrantfile and Ansible Playbook setup for deploying and running Skosmos in virtual environment

* Add .vagrant and .DS_Store to .gitignore

* Remove unnecessary installation of Python 2.7 and configure to use python3

* Removed old config files and added references to eclipse project file to .gitignore

* Remove Fuseki deployment

* Fix apt not installing php-mbstring by updating cache before apt install

* Turn off verbose/debug mode for Ansible provisioner

* Delete .DS_Store

* Delete second .DS_Store

* Remove unnecessary, duplicate configuration file

* Add Vagrantfile and Ansible Playbook setup for deploying and running Skosmos in virtual environment

* Add .vagrant and .DS_Store to .gitignore

* Remove unnecessary installation of Python 2.7 and configure to use python3

* Removed old config files and added references to eclipse project file to .gitignore

* Remove Fuseki deployment

* Fix apt not installing php-mbstring by updating cache before apt install

* Turn off verbose/debug mode for Ansible provisioner

* Delete .DS_Store

* Delete second .DS_Store

* Remove unnecessary, duplicate configuration file

* reorder .gitignore

* Use correct value when retrieving settings

* Add tests for GlobalConfig

* Add more tests for VoacabularyConfig

* Use array in the test for GlobalConfig::getGlobalPlugins

* Fix parameter order for jena-text queries - MAX_N setting was being ignored. Fixes NatLibFi#794

* Loosen the check for port numbers in guessBaseHref. Fixes NatLibFi#796

* removed references to old configuration files

* Choose feedback recipient based on selection on feedback form, not the URL from which the feedback page was invoked. Fixes NatLibFi#808

* Fix unit test that broke after the fix to NatLibFi#808

(cherry picked from commit 1a55e8b)

* Fix fragile unit test (may break if /tmp/skosmos-template-cache exists but is owned by another user)

* Fix config migration of LOG_FILE_NAME=null

Fixes NatLibFi#801

* fixes NatLibFi#804

* fix some css; addresses issue NatLibFi#799

* Added a check for empty arrays to avoid the situation in NatLibFi#813

* #fixes NatLibFi#791; also update fuseki to 3.9.0

* Reenable Fuseki snapshot builds on Travis; use Fuseki2 3.9.0 on Travis instead of 3.8.0

* Don't allow Travis builds with PHP 7.2 to fail; run Fuseki snapshot builds with PHP 7.2. Related to NatLibFi#758

* check which locales are installed in Travis environment

* Try to break unit tests by setting LANGUAGE=fr. Part of NatLibFi#816

* Always set LANGUAGE environment variable when setting LC_ALL. Fixes NatLibFi#816

* update gitignore to match Fuseki2 directory naming (NatLibFi#791)

* Update fi, sv UI translations for skos:relatedMatch. Fixes NatLibFi#707

* support for MARC sources in REST controller

* fix updated, unit tests passed

* Display concept types for search

* Adapt code from concepts page

* Added the new icon and updated tooltip translations

* refactor: rename function for clarity, and make it private since it's only needed internally

* Rewrite concept group handling to take into account multiple hierarchical groups. Fixes NatLibFi#811

* Fix display of array property values

* Use test-specific template cache dir to avoid permission problems. Fixes NatLibFi#821

* updated translations for Finnish, Swedish and German

* Fix case when a concept property value is from another vocabulary. Fixes NatLibFi#819

* Fix concept group display also in search result list. Related to NatLibFi#811

* Don't perform label and subPropertyOf lookups for well-known properties. Part of NatLibFi#836

(cherry picked from commit 9de5b86)

* Switch from FILTER NOT EXISTS to MINUS to avoid Jena 3.8+ performance issue. Fixes NatLibFi#829

(cherry picked from commit 00eabb3)

* Also move the VALUES block to avoid Jena 3.8+ performance issues. Fixes NatLibFi#829

(cherry picked from commit 3e4884c)

* Avoid second unnecessary getProperties call in search result list. Part of NatLibFi#836

(cherry picked from commit 995777a)

* Avoid unnecessary properties when calling getMappingProperties from search result page. Part of NatLibFi#836

(cherry picked from commit 50bb1a1)

* Add a cache to avoid computing language order many times during a request

(cherry picked from commit c10bd71)

* Update of Fira Sans embedded fonts with newer version from https://github.com/mozilla/Fira/tree/4.202
- related to bug NatLibFi#855

* Fixed function calls for getLiteral with property and lang

(cherry picked from commit 499e38a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants