Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Commit

Permalink
Merge branch 'birds'
Browse files Browse the repository at this point in the history
  • Loading branch information
rasvaan committed Nov 23, 2016
2 parents 81c0063 + a547168 commit 9b933c7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 36 deletions.
10 changes: 3 additions & 7 deletions rdf/domain/bird/bird_domain.ttl
Expand Up @@ -3,7 +3,7 @@
@prefix abirui: <http://accurator.nl/ui/bird#> .
@prefix aabir: <http://accurator.nl/ui/annotation/bird#> .
@prefix auis: <http://accurator.nl/ui/schema#> .
@prefix birds: <http://purl.org/collections/birds/> .
@prefix ioc: <http://purl.org/vocab/ioc/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms:<http://purl.org/dc/terms/> .
Expand All @@ -13,16 +13,12 @@
abir:domain a accu:Domain ;
rdfs:label "bird";
accu:hasLabel abirui:label ;
dcterms:requires <http://purl.org/collections/nl/naturalis/ioc_birdlist_en_nl.ttl> ;
accu:hasTarget <http://accurator.nl/bird#Target> ;
skos:hasTopConcept birds:class-aves ;
accu:hasUI abirui: ;
accu:hasAnnotationUI aabir:smallBirdAnnotationUi ;
accu:hasDescriptiveImage abirui:bird ;
accu:hasMaximumExpertiseTopics "50" ;
accu:hasMaximumChildren "2" .
accu:hasDescriptiveImage abirui:bird .

<http://purl.org/collections/nl/naturalis/ioc_birdlist_en_nl.ttl> a skos:ConceptScheme .
<http://purl.org/vocab/ioc/ioc_birdlist_en_nl.ttl> a skos:ConceptScheme .

abirui:label auis:textLabel "Bird domain"@en ,
"Vogel domein"@nl .
Expand Down
32 changes: 16 additions & 16 deletions rdf/domain/bird/ui/fields.ttl
@@ -1,15 +1,15 @@
@prefix aabir: <http://accurator.nl/ui/annotation/bird#> .
@prefix auis: <http://accurator.nl/ui/schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms:<http://purl.org/dc/terms/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix aabir: <http://accurator.nl/ui/annotation/bird#> .
@prefix auis: <http://accurator.nl/ui/schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

aabir:smallBirdAnnotationUi a auis:AnnotationUI ;
dcterms:title "Bird annotation UI"@en;
dcterms:title "Bird annotation UI"@en;
auis:fragmentFields (
aabir:IOCCommonNameAnnotation
aabir:IOCScientificNameAnnotation
aabir:IOCCommonNameAnnotation
aabir:IOCScientificNameAnnotation
) .

aabir:birdAnnotationUi a auis:AnnotationUI ;
Expand All @@ -31,9 +31,9 @@ aabir:IOCCommonNameAnnotation a auis:DropdownField ;
auis:source aabir:IOCCommonNameSource .

aabir:IOCCommonNameSource a auis:AlternativesSource ;
auis:api "/api/autocomplete" ;
auis:filterScheme "http://purl.org/collections/birds/IOCConceptScheme" ;
auis:labelRank "['http://lod.taxonconcept.org/ontology/txn.owl%23commonName'-1]" .
auis:api "/api/autocomplete/all" ;
auis:filterScheme "http://purl.org/vocab/ioc/IOCConceptScheme" ;
auis:labelRank "['http://lod.taxonconcept.org/ontology/txn.owl#commonName'-1]" .

aabir:IOCScientificNameAnnotation a auis:DropdownField ;
rdfs:label "Scientific name"@en ;
Expand All @@ -43,11 +43,11 @@ aabir:IOCScientificNameAnnotation a auis:DropdownField ;
auis:source aabir:IOCScientificNameSource .

aabir:IOCScientificNameSource a auis:AlternativesSource ;
auis:api "/api/autocomplete" ;
auis:filterScheme "http://purl.org/collections/birds/IOCConceptScheme" ;
auis:labelRank "['http://lod.taxonconcept.org/ontology/txn.owl%23scientificName'-1]" .
auis:api "/api/autocomplete/all" ;
auis:filterScheme "http://purl.org/vocab/ioc/IOCConceptScheme" ;
auis:labelRank "['http://lod.taxonconcept.org/ontology/txn.owl#scientificName'-1]" .

aabir:Gender a auis:RadioButtonField ;
aabir:Gender a auis:DropdownField ;
rdfs:label "Geslacht"@nl ;
rdfs:label "Gender"@en ;
dcterms:comment "add gender of the species"@en ;
Expand Down
27 changes: 14 additions & 13 deletions web/js/components/field.js
Expand Up @@ -295,24 +295,25 @@ DropdownField.prototype.addDropdownListeners = function() {
}

DropdownField.prototype.getAllAlternatives = function() {
//HACK for getting EN resources Iconclass
var locale = this.locale;
var parameters = { q:"stub", method:"all" };

if (this.source.filterScheme === "http://accurator.nl/bible#BiblicalThemeConceptScheme") {
locale = "en";
locale = "en"; //HACK for getting EN resources Iconclass
}
parameters.locale = locale;

// Create filter with eiter class or scheme, scheme has precedence
if (this.source.filterScheme) {
parameters.filter = JSON.stringify({ "scheme":this.source.filterScheme });
}

if (this.source.labelRank) {
parameters.labelrank = this.source.labelRank;
}

// Get autocomplete alternatives
var filter = JSON.stringify({scheme: this.source.filterScheme});
// var labelRank = "['http://www.w3.org/2004/02/skos/core#prefLabel'-1]";

// Return promise
return $.getJSON("api/autocomplete", {
q:"stub",
filter:filter,
// labelrank:labelRank,
method:"all",
locale:locale //HACK: should be this.locale
});
return $.getJSON("api/autocomplete", parameters);
}

DropdownField.prototype.addTypeAhead = function() {
Expand Down

0 comments on commit 9b933c7

Please sign in to comment.