Commit dd0adbb5 authored by Matthias Tietz's avatar Matthias Tietz
Browse files

add new files

parents ef12178b d3497db2
......@@ -29,7 +29,7 @@ You need to use the cmd line tools for a new TISAF installation (e.g. `/opt/fuse
- b) owl/rdf/rdfs file:
- use [Skosify](https://github.com/NatLibFi/Skosify/) with e.g. `skosify file.owl -c examples/dctype.cfg --o output.ttl --label "my terminology lalbel"`
- c) MADS file ([Example](http://id.loc.gov/vocabulary/mencformat.html))
- use [rdfonto2skos](https://github.com/matthiastz/rdfonto2skos) (form from Skosify) with e.g. `python skosify.py file.owl -c examples/mads2skos.cfg --o output.ttl --label "my terminology lalbel"`
- use [rdfonto2skos](https://github.com/matthiastz/rdfonto2skos) (fork from Skosify) with e.g. `python skosify.py file.owl -c examples/mads2skos.cfg --o output.ttl --label "my terminology lalbel"`
3. Load data:
- a) via cmd line
......@@ -51,7 +51,7 @@ So you have to apply the following configuration step:
4. change config.ttl to add an entry for the new terminology, e.g.: (minimum)
```
:terminolog-id a skosmos:Vocabulary, void:Dataset ;
:terminology-id a skosmos:Vocabulary, void:Dataset ;
dc:title "my terminology title"@en ;
skosmos:shortName "terminology short name (used for gui dropdown)";
dc:subject :category_name ;
......@@ -83,6 +83,7 @@ post_max_size = 30M # post_max should be a bit bigger; original: 8M
Sync the values between the frontend part in [tisaf.js](resource/js/tisaf.js) and your php.ini.
And do not forget to: `sudo service apache2 restart`.
Btw, this can also be the fix if you get the error `Input file was not uploaded correctly. Please check the name, size and file type...`
### Adding/changing translations ([see GitHub doc](https://github.com/NatLibFi/Skosmos/wiki/Translation))
......
......@@ -152,12 +152,12 @@ class RestController extends Controller
{
$parameters = new ConceptSearchParameters($request, $this->model->getConfig(), true);
$vocabs = $request->getQueryParam('vocab'); # optional
$vocabs = $request->getQueryParam('terminologies'); # optional
// convert to vocids array to support multi-vocabulary search
$vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : array();
$vocids = ($vocabs !== null && $vocabs !== '') ? explode(',', $vocabs) : array();
$vocabObjects = array();
foreach($vocids as $vocid) {
$vocabObjects[] = $this->model->getVocabulary($vocid);
$vocabObjects[] = $this->model->getVocabulary(trim($vocid));
}
$parameters->setVocabularies($vocabObjects);
return $parameters;
......@@ -189,6 +189,8 @@ class RestController extends Controller
// build usable redirect uri
$res['vocabRef'] = $fullSystemHost . $vocab->getId();
$outProps = ['skos:altLabel', 'skos:narrower', 'skos:related', 'skos:broader',
"skos:definition", "skos:example"];
$outProps = ['skos:altLabel', 'skos:narrower', 'skos:related', 'skos:broader', 'skos:definition'];
foreach ($outProps as $prop) {
if (key_exists($prop, $props)) {
......@@ -1195,7 +1197,7 @@ class RestController extends Controller
return null;
}
$narrowers = $request->getVocab()->getConceptNarrowers($request->getUri(), $request->getLang());
// if uri owl:sameAs object -> get info from object too in result!
$uri = $request->getUri();
$vocab = $request->getVocab();
......@@ -1216,8 +1218,8 @@ WHERE{
}
EOD;
$result = $request->getVocab()->getSparql()->execute($queryString);
if ($result instanceof Result && $result->count() == 1) {
// TODO: additional check: check if graphName -> vocabId -> tisafUriValue.contains(vocabId)
$twinUri = $result[0]->s->getUri();
......@@ -1859,11 +1861,11 @@ EOD;
$sparql = $vocab->getSparql();
$countResult = $sparql->execute($countQueryString);
// count skos:Concept
$conceptCount = rand();
try {
$conceptCount = $countResult[0]->count->getValue();
$conceptCount = $countResult[0]->count->getValue();
} catch (Exception $e) {
error_log("Exception" . $e->getMessage());
}
......
......@@ -48,3 +48,12 @@ instead of one single very long row:
`"skos:prefLabel "The Creative Commons Rights Expression Language (CC REL) lets you describe copyright licenses in RDF. For more information on describing licenses in RDF and attaching those descriptions to digital works, see CC REL in the Creative Commons wiki."@en .`
why? because there is a special skos syntax for these cases and to prevent presentation issues in the web gui
#### more hints for valid rdf syntax (EasyRDF)
see https://www.w3.org/TR/turtle/#sec-escapes, https://w3c.github.io/rdf-tests/turtle/
Recommendation (escape -, .):
- prefx:x-y prop object -> \<prefix:x-y\> prop object
- prefx:x.y prop object -> \<prefix:x.y\> prop object
\ No newline at end of file
......@@ -115,6 +115,8 @@ WHERE{
#### DROP named graph
see https://www.w3.org/TR/sparql11-update/#drop
(need to do that on /skosmos/, not /skosmos/sparql)
```
DROP SILENT GRAPH <graph>
```
......
......@@ -4,7 +4,7 @@ const API = 'https://www.tisaf.de/rest/v1';
const ttPrefix = "http://www.tisaf.de/tags/";
// TODO: n3, n-triples would be also possible. see PHP Easy RDF Format.php
const allowedRdfFileTypes =
['application/rdf+xml', 'text/turtle', 'application/ld+json', 'application/json']
['application/rdf+xml', 'text/turtle', 'application/ld+json', 'application/json', 'text/plain', 'application/n-triples']
const sourceInput = $("input[name='source']");
const vocabIdInput = $("input[name='terminologyID']");
......@@ -278,6 +278,8 @@ function submitImportForm() {
// blob
const skosFile = $("input#skosFile")[0].files[0];
debugger
if (!allowedRdfFileTypes.some((allowedType) => allowedType === skosFile.type)) {
const errorText = `SKOS input file has unsupported file type: ${skosFile.type}!
Allowed types: ${allowedRdfFileTypes}.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
@prefix cc: <http://creativecommons.org/ns/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
cc:Attribution a skos:Concept ;
rdfs:comment "credit be given to copyright holder and/or author"@en ;
skos:broader cc:Requirement ;
skos:inScheme cc:rel ;
skos:prefLabel "Attribution"@en .
cc:Commercial_Use a skos:Concept ;
rdfs:comment "exercising rights for commercial purposes"@en ;
skos:broader cc:Prohibition ;
skos:inScheme cc:rel ;
skos:prefLabel "Commercial Use"@en .
cc:Copyleft a skos:Concept ;
rdfs:comment "derivative and combined works must be licensed under specified terms, similar to those on the original work"@en ;
skos:broader cc:Requirement ;
skos:inScheme cc:rel ;
skos:prefLabel "Copyleft"@en .
cc:Derivative_Works a skos:Concept ;
rdfs:comment "distribution of derivative works"@en ;
skos:broader cc:Permission ;
skos:inScheme cc:rel ;
skos:prefLabel "Derivative Works"@en .
cc:Distribution a skos:Concept ;
rdfs:comment "distribution, public display, and publicly performance"@en ;
skos:broader cc:Permission ;
skos:inScheme cc:rel ;
skos:prefLabel "Distribution"@en .
cc:High_Income_Nation_Use a skos:Concept ;
rdfs:comment "use in a non-developing country"@en ;
skos:broader cc:Prohibition ;
skos:inScheme cc:rel ;
skos:prefLabel "High Income Nation Use"@en .
cc:Lesser_Copyleft a skos:Concept ;
rdfs:comment "derivative works must be licensed under specified terms, with at least the same conditions as the original work; combinations with the work may be licensed under different terms"@en ;
skos:broader cc:Requirement ;
skos:inScheme cc:rel ;
skos:prefLabel "Lesser Copyleft"@en .
cc:Notice a skos:Concept ;
rdfs:comment "copyright and license notices be kept intact"@en ;
skos:broader cc:Requirement ;
skos:inScheme cc:rel ;
skos:prefLabel "Notice"@en .
cc:Reproduction a skos:Concept ;
rdfs:comment "making multiple copies"@en ;
skos:broader cc:Permission ;
skos:inScheme cc:rel ;
skos:prefLabel "Reproduction"@en .
cc:Share_Alike a skos:Concept ;
rdfs:comment "derivative works be licensed under the same terms or compatible terms as the original work"@en ;
skos:broader cc:Requirement ;
skos:inScheme cc:rel ;
skos:prefLabel "Share Alike"@en .
cc:Sharing a skos:Concept ;
rdfs:comment "permits commercial derivatives, but only non-commercial distribution"@en ;
skos:broader cc:Permission ;
skos:inScheme cc:rel ;
skos:prefLabel "Sharing"@en .
cc:Source_Code a skos:Concept ;
rdfs:comment "source code (the preferred form for making modifications) must be provided when exercising some rights granted by the license."@en ;
skos:broader cc:Requirement ;
skos:inScheme cc:rel ;
skos:prefLabel "Source Code"@en .
cc:attributionName a skos:Concept ;
rdfs:label "attribution name"@en ;
rdfs:comment "The name the creator of a Work would like used when attributing re-use."@en ;
rdfs:domain cc:Work ;
rdfs:seeAlso cc:Work ;
skos:broader cc:Work ;
skos:inScheme cc:rel ;
skos:prefLabel "attribution name"@en .
cc:attributionURL a skos:Concept ;
rdfs:label "attribution URL"@en ;
rdfs:comment "The URL the creator of a Work would like used when attributing re-use."@en ;
rdfs:domain cc:Work ;
rdfs:seeAlso cc:Work,
<https://www.w3.org/2000/01/rdf-schema#Resource> ;
skos:broader cc:Work ;
skos:inScheme cc:rel ;
skos:prefLabel "attribution URL"@en .
cc:deprecatedOn a skos:Concept ;
rdfs:label "deprecated on"@en ;
rdfs:comment "A License may be deprecated; provides the date deprecated on."@en ;
rdfs:domain cc:License ;
rdfs:seeAlso <https://www.w3.org/2001/XMLSchema-datatypes#date> ;
skos:broader cc:License ;
skos:inScheme cc:rel ;
skos:prefLabel "deprecated on"@en .
cc:legalcode a skos:Concept ;
rdfs:label "legalcode"@en ;
rdfs:comment "The URL of the legal text of a License."@en ;
rdfs:domain cc:License ;
rdfs:seeAlso <https://www.w3.org/2000/01/rdf-schema#Resource> ;
skos:broader cc:License ;
skos:inScheme cc:rel ;
skos:prefLabel "legalcode"@en .
cc:licenseProp a skos:Concept ;
rdfs:label "license"@en ;
rdfs:comment "A Work has license a License."@en ;
rdfs:domain cc:Work ;
rdfs:seeAlso cc:License,
cc:Work ;
rdfs:subPropertyOf dc:license ;
owl:sameAs <https://www.w3.org/1999/xhtml/vocab#license> ;
skos:broader cc:Work ;
skos:inScheme cc:rel ;
skos:prefLabel "license"@en .
cc:morePermissions a skos:Concept ;
rdfs:label "more permissions"@en ;
rdfs:comment "A related resource which describes additional permissions or alternative licenses for a Work which may be available."@en ;
rdfs:domain cc:Work ;
rdfs:seeAlso cc:Work ;
skos:broader cc:Work ;
skos:inScheme cc:rel ;
skos:prefLabel "more permissions"@en .
cc:useGuidelines a skos:Concept ;
rdfs:label "use guidelines"@en ;
rdfs:comment "A related resource which defines non-binding use guidelines for the work."@en ;
rdfs:domain cc:Work ;
rdfs:seeAlso cc:Work ;
skos:broader cc:Work ;
skos:inScheme cc:rel ;
skos:prefLabel "use guidelines"@en .
cc:jurisdiction a skos:Concept ;
rdfs:label "jurisdiction"@en ;
rdfs:comment "A License may have a jurisdiction, as defined by Jurisdictions."@en ;
rdfs:domain cc:License ;
rdfs:range cc:Jurisdiction ;
skos:broader cc:License ;
skos:inScheme cc:rel ;
skos:prefLabel "jurisdiction"@en ;
skos:related cc:Jurisdiction .
cc:permits a skos:Concept ;
rdfs:label "permits"@en ;
rdfs:comment "A License permits a Permission."@en ;
rdfs:domain cc:License ;
rdfs:range cc:Permission ;
skos:broader cc:License ;
skos:inScheme cc:rel ;
skos:prefLabel "permits"@en ;
skos:related cc:Permission .
cc:prohibits a skos:Concept ;
rdfs:label "prohibits"@en ;
rdfs:comment "A License prohibits a Prohibition."@en ;
rdfs:domain cc:License ;
rdfs:range cc:Prohibition ;
skos:broader cc:License ;
skos:inScheme cc:rel ;
skos:prefLabel "prohibits"@en ;
skos:related cc:Prohibition .
cc:requires a skos:Concept ;
rdfs:label "requires"@en ;
rdfs:comment "A License requires a Requirement."@en ;
rdfs:domain cc:License ;
rdfs:range cc:Requirement ;
skos:broader cc:License ;
skos:inScheme cc:rel ;
skos:prefLabel "requires"@en ;
skos:related cc:Requirement .
cc:Jurisdiction a skos:Concept ;
rdfs:label "Jurisdiction"@en ;
rdfs:comment "the legal jurisdiction of a license"@en ;
skos:inScheme cc:rel ;
skos:prefLabel "Jurisdiction"@en ;
skos:related cc:jurisdiction ;
skos:topConceptOf cc:rel .
cc:Prohibition a skos:Concept ;
rdfs:label "Prohibition"@en ;
rdfs:comment "something you may be asked not to do"@en ;
skos:inScheme cc:rel ;
skos:narrower cc:Commercial_Use,
cc:High_Income_Nation_Use ;
skos:prefLabel "Prohibition"@en ;
skos:related cc:prohibits ;
skos:topConceptOf cc:rel .
cc:Permission a skos:Concept ;
rdfs:label "Permission"@en ;
rdfs:comment "an action that may or may not be allowed or desired"@en ;
skos:inScheme cc:rel ;
skos:narrower cc:Derivative_Works,
cc:Distribution,
cc:Reproduction,
cc:Sharing ;
skos:prefLabel "Permission"@en ;
skos:related cc:permits ;
skos:topConceptOf cc:rel .
cc:Requirement a skos:Concept ;
rdfs:label "Requirement"@en ;
rdfs:comment """an action that may or
may not be requested of you"""@en ;
skos:inScheme cc:rel ;
skos:narrower cc:Attribution,
cc:Copyleft,
cc:Lesser_Copyleft,
cc:Notice,
cc:Share_Alike,
cc:Source_Code ;
skos:prefLabel "Requirement"@en ;
skos:related cc:requires ;
skos:topConceptOf cc:rel .
cc:License a skos:Concept ;
rdfs:label "License"@en ;
rdfs:comment "a set of requests/permissions to users of a Work, e.g. a copyright license, the public domain, information for distributors"@en ;
rdfs:seeAlso dct:LicenseDocument ;
skos:inScheme cc:rel ;
skos:narrower cc:deprecatedOn,
cc:jurisdiction,
cc:legalcode,
cc:permits,
cc:prohibits,
cc:requires ;
skos:prefLabel "License"@en ;
skos:topConceptOf cc:rel .
cc:Work a skos:Concept ;
rdfs:label "Work"@en ;
rdfs:comment "a potentially copyrightable work"@en ;
skos:inScheme cc:rel ;
skos:narrower cc:attributionName,
cc:attributionURL,
cc:licenseProp,
cc:morePermissions,
cc:useGuidelines ;
skos:prefLabel "Work"@en ;
skos:topConceptOf cc:rel .
cc:rel a skos:ConceptScheme ;
dc:description "The Creative Commons Rights Expression Language (CC REL) lets you describe copyright licenses in RDF. For more information on describing licenses in RDF and attaching those descriptions to digital works, see CC REL in the Creative Commons wiki."@en ;
dct:source <https://creativecommons.org/ns> ;
rdfs:seeAlso <https://wiki.creativecommons.org/>,
<https://wiki.creativecommons.org/CC_REL> ;
skos:hasTopConcept cc:Jurisdiction,
cc:License,
cc:Permission,
cc:Prohibition,
cc:Requirement,
cc:Work ;
skos:prefLabel "The Creative Commons Rights Expression Language (CC REL) lets you describe copyright licenses in RDF. For more information on describing licenses in RDF and attaching those descriptions to digital works, see CC REL in the Creative Commons wiki."@en .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix tisaf: <http://vsrstud01.informatik.tu-chemnitz.de/tisaf/> .
@prefix tt: <http://vsrstud01.informatik.tu-chemnitz.de/tisaf/tags/> .
tt:Agriculture a skos:Concept ;
skos:broader tt:Life_Sciences ;
skos:inScheme tt:tags ;
skos:prefLabel "Agriculture, Forestry, Horticulture and Veterinary Medicine"@en .
tt:Analytical_Chemistry_Method_Development a skos:Concept ;
skos:broader tt:Chemistry ;
skos:inScheme tt:tags ;
skos:prefLabel "Analytical Chemistry, Method Development"@en .
tt:Ancient_Cultures a skos:Concept ;
skos:broader tt:Humanities ;
skos:inScheme tt:tags ;
skos:prefLabel "Ancient Cultures"@en .
tt:Arts a skos:Concept ;
skos:broader tt:Humanities ;
skos:inScheme tt:tags ;
skos:prefLabel "Fine Arts, Music, Theatre and Media Studies"@en .
tt:Astrophysics_Astronomy a skos:Concept ;
skos:broader tt:Physics ;
skos:inScheme tt:tags ;
skos:prefLabel "Astrophysics and Astronomy"@en .
tt:Atmospheric_Science_Oceanography a skos:Concept ;
skos:broader tt:Geosciences_Geography ;
skos:inScheme tt:tags ;
skos:prefLabel "Atmospheric Science and Oceanography"@en .
tt:Basic_Bio_Medical a skos:Concept ;
skos:broader tt:Biology ;
skos:inScheme tt:tags ;
skos:prefLabel "Basic Biological and Medical Research"@en .
tt:Biological_Chemistry_Food_Chemistry a skos:Concept ;
skos:broader tt:Chemistry ;
skos:inScheme tt:tags ;
skos:prefLabel "Biological Chemistry and Food Chemistry"@en .
tt:Chemical_Solid_State_Surface_Research a skos:Concept ;
skos:broader tt:Chemistry ;
skos:inScheme tt:tags ;
skos:prefLabel "Chemical Solid State and Surface Research"@en .
tt:Computer_Science a skos:Concept ;
skos:broader tt:Computer_Science_Electrical_System_Engineering ;
skos:inScheme tt:tags ;
skos:prefLabel "Computer Science"@en .
tt:Condensed_Matter_Physics a skos:Concept ;
skos:broader tt:Physics ;
skos:inScheme tt:tags ;
skos:prefLabel "Condensed Matter Physics"@en .
tt:Construction_Engineering_Architecture a skos:Concept ;
skos:broader tt:Engineering_Sciences ;
skos:inScheme tt:tags ;
skos:prefLabel "Construction Engineering and Architecture"@en .
tt:Culture_Social_Religion a skos:Concept ;
skos:broader tt:Humanities ;
skos:inScheme tt:tags ;
skos:prefLabel "Non-European Languages and Cultures, Social and Cultural Anthropology, Jewish Studies and Religious Studies"@en .
tt:Economics a skos:Concept ;
skos:broader tt:Social_Behavioural_Sciences ;
skos:inScheme tt:tags ;
skos:prefLabel "Economics"@en .
tt:Education_Sciences a skos:Concept ;
skos:broader tt:Social_Behavioural_Sciences ;
skos:inScheme tt:tags ;
skos:prefLabel "Education Sciences"@en .
tt:Electrical_Engineering a skos:Concept ;
skos:broader tt:Computer_Science_Electrical_System_Engineering ;
skos:inScheme tt:tags ;
skos:prefLabel "Electrical Engineering"@en .
tt:Geochemistry_Mineralogy_Crystallography a skos:Concept ;
skos:broader tt:Geosciences_Geography ;
skos:inScheme tt:tags ;
skos:prefLabel "Geochemistry, Mineralogy and Crystallography"@en .
tt:Geography a skos:Concept ;
skos:broader tt:Geosciences_Geography ;
skos:inScheme tt:tags ;
skos:prefLabel "Geography"@en .
tt:Geology_Palaeontology a skos:Concept ;
skos:broader tt:Geosciences_Geography ;
skos:inScheme tt:tags ;
skos:prefLabel "Geology and Palaeontology"@en .
tt:Geophysics_Geodesy a skos:Concept ;
skos:broader tt:Geosciences_Geography ;
skos:inScheme tt:tags ;
skos:prefLabel "Geophysics and Geodesy"@en .
tt:Heat_Energy_Technology_Thermal_Machines_Fluid_Mechanics a skos:Concept ;
skos:broader tt:Thermal_Engineering_Process_Engineering ;
skos:inScheme tt:tags ;
skos:prefLabel "Heat Energy Technology, Thermal Machines, Fluid Mechanics"@en .
tt:History a skos:Concept ;
skos:broader tt:Humanities ;
skos:inScheme tt:tags ;
skos:prefLabel "History"@en .
tt:Jurisprudence a skos:Concept ;
skos:broader tt:Social_Behavioural_Sciences ;
skos:inScheme tt:tags ;
skos:prefLabel "Jurisprudence"@en .
tt:Linguistics a skos:Concept ;
skos:broader tt:Humanities ;
skos:inScheme tt:tags ;
skos:prefLabel "Linguistics"@en .
tt:Literary_Studies a skos:Concept ;
skos:broader tt:Humanities ;
skos:inScheme tt:tags ;
skos:prefLabel "Literary Studies"@en .
tt:Materials_Engineering a skos:Concept ;
skos:broader tt:Materials_Science_Engineering ;
skos:inScheme tt:tags ;
skos:prefLabel "Materials Engineering"@en .
tt:Materials_Science a skos:Concept ;
skos:broader tt:Materials_Science_Engineering ;
skos:inScheme tt:tags ;
skos:prefLabel "Materials Science"@en .
tt:Mathematics a skos:Concept ;
skos:broader tt:Natural_Sciences ;
skos:inScheme tt:tags ;
skos:prefLabel "Mathematics"@en .
tt:Mechanics_Constructive_Mechanical_Engineering a skos:Concept ;
skos:broader tt:Mechanical_industrial_Engineering ;
skos:inScheme tt:tags ;
skos:prefLabel "Mechanics and Constructive Mechanical Engineering"@en .
tt:Medicine a skos:Concept ;
skos:broader tt:Medical_Sciences ;
skos:inScheme tt:tags ;
skos:prefLabel "Medicine"@en .
tt:Microbiology_Virology_Immunology a skos:Concept ;
skos:broader tt:Medical_Sciences ;
skos:inScheme tt:tags ;
skos:prefLabel "Microbiology, Virology and Immunology"@en;
skos:definition "Virology and Immunology develops vaccines and therapeutics against viral pathogens, and determines how viruses replicate and spread through basic and applied research."@en
.
tt:Molecular_Chemistry a skos:Concept ;
skos:broader tt:Chemistry ;
skos:inScheme tt:tags ;
skos:prefLabel "Molecular Chemistry"@en .
tt:Neurosciences a skos:Concept ;
skos:broader tt:Medical_Sciences ;
skos:inScheme tt:tags ;
skos:prefLabel "Neurosciences"@en .
tt:Optics_Quantum_Optics_Physics_Atoms_Molecules_Plasmas a skos:Concept ;
skos:broader tt:Physics ;
skos:inScheme tt:tags ;