accurator/commit
Changed domain api.
author | Chris Dijkshoorn |
---|---|
Tue Apr 12 09:27:53 2016 +0200 | |
committer | Chris Dijkshoorn |
Tue Apr 12 09:27:53 2016 +0200 | |
commit | d20a5c6fcfdc798f05a914ad66ec4ee6138207f8 |
tree | 43eb2413cee97a368f153cba716d1404cfbd0bd0 |
parent | 5eaff5ac595d89d0f5a01b9c7e5d70e4fdc43f4c |
Diff style: patch stat
diff --git a/lib/accurator/domain.pl b/lib/accurator/domain.pl index 2bb7c7b..fb5c7e3 100644 --- a/lib/accurator/domain.pl +++ b/lib/accurator/domain.pl @@ -5,9 +5,6 @@ :- use_module(library(semweb/rdf_db)). :- use_module(library(semweb/rdfs)). -:- rdf_meta - rdf_value(r, -, -). - %% get_domain_settings(-Dic, +Options) % % If no domain is provided, return available domains. If domain is @@ -18,7 +15,10 @@ get_domain_settings(Dic, Options) :- var(Domain), !, findall(Domain, ( rdf(DomainUri, rdf:type, accu:'Domain'), - rdf(DomainUri, rdfs:label, literal(Domain))), + rdf(DomainUri, rdfs:label, literal(Domain)), %TODO FIX THIS SO THAT ONLY ROOT + rdf(SuperDomain, accu:subDomains, DomainUri), + var(SuperDomain) + ), Domains), Dic = Domains. diff --git a/web/js/components/utilities.js b/web/js/components/utilities.js index a1f8e09..15400f5 100644 --- a/web/js/components/utilities.js +++ b/web/js/components/utilities.js @@ -215,7 +215,7 @@ Functionallity making the ui adapt *******************************************************************************/ function getUI(domainSettings, page) { if(typeof domainSettings != 'undefined') { - return domainSettings.ui + page + return domainSettings.hasUI + page } else { return "http://accurator.nl/ui/generic#" + page; } diff --git a/web/js/domain.js b/web/js/domain.js index 9944a73..772476e 100644 --- a/web/js/domain.js +++ b/web/js/domain.js @@ -72,7 +72,7 @@ function populateDomains(locale, domainLabels) { function domainHtml(domainData, row, locale) { var domain = domainData.domain; - getLabels(locale, domainData.ui + "domain") + getLabels(locale, domainData.hasUI + "domain") .then(function(labels) { $("#domain" + row).append( $.el.div({'class':'noPadding col-md-6'}, @@ -81,9 +81,9 @@ function domainHtml(domainData, row, locale) { labels.domainLabel), $.el.img({'class':'domainImg', 'id':'domainImg' + domain, - 'src':domainData.image}))); + 'src':domainData.hasDescriptiveImage}))); - if(domainData.image_brightness === "dark") + if(domainData.imageBrightness === "dark") $("#domainTxt" + domainData.domain).css('color', '#fff'); addDomainEvent(domain); diff --git a/web/js/expertise.js b/web/js/expertise.js index 0fa0f4c..c909012 100644 --- a/web/js/expertise.js +++ b/web/js/expertise.js @@ -32,7 +32,7 @@ function expertiseInit() { user = userData.user; var userName = getUserName(user); populateNavbar(userName, [{link:"profile.html", name:"Profile"}], locale); - return getLabels(locale, domainData.ui + "expertise"); + return getLabels(locale, domainData.hasUI + "expertise"); }) .then(function(labels) { var labelArray = initLabels(labels); @@ -71,10 +71,10 @@ function registerEvents(topics, user) { function initExpertiseTopics(domainData, locale, labels) { return $.getJSON("expertise_topics", { locale:locale, - taxonomy:domainData.taxonomy, - top_concept:domainData.top_concept, - number_of_topics:domainData.number_of_topics, - number_of_children_shown:domainData.number_of_children_shown + taxonomy:domainData.requires, + top_concept:domainData.hasTopConcept, + number_of_topics:domainData.hasMaximumExpertiseTopics, + number_of_children_shown:domainData.hasMaximumChildren }) .then(function(data){ var topics = generateIds(data.topics); diff --git a/web/js/intro.js b/web/js/intro.js index e15fba9..75dbac3 100644 --- a/web/js/intro.js +++ b/web/js/intro.js @@ -22,7 +22,7 @@ function introInit() { }) .then(function(domainSettings) { var ui = getUI(domainSettings, "intro"); - setBackground(domainSettings.image, domainSettings.image_brightness); + setBackground(domainSettings.image, domainSettings.imageBrightness); return getLabels(locale, ui); }) .then(function(labels) { @@ -46,7 +46,7 @@ function addButtonEvents(settings) { var onDismissal = function() { $("#registerDivRegister").modal('hide'); }; - + registerModal(onDismissal, settings); }); $("#introBtnLogin").click(function() { diff --git a/web/js/item.js b/web/js/item.js index 1037fc1..42a9ce8 100644 --- a/web/js/item.js +++ b/web/js/item.js @@ -60,8 +60,8 @@ function itemInit() { domainSettings(domain) .then(function(domainData) { - ui = domainData.ui + "item"; - annotation_ui = domainData.annotation_ui; + ui = domainData.hasUI + "item"; + annotation_ui = domainData.hasAnnotationUI; return getLabels(locale, ui); }) .then(function(labelData){ diff --git a/web/js/profile.js b/web/js/profile.js index 23fdd5c..0e29b2b 100644 --- a/web/js/profile.js +++ b/web/js/profile.js @@ -35,7 +35,7 @@ function profileInit() { domainSettings(domain) .then(function(domainData) { - return getLabels(locale, domainData.ui + "profile"); + return getLabels(locale, domainData.hasUI + "profile"); }) .then(function(labelData) { addButtonEvents(user); @@ -131,7 +131,7 @@ function initDomains(locale, domain, labels) { function addDomainTitle(domainData, locale, labels) { // add the title of the current domain to the profile page - getLabels(locale, domainData.ui + "domain") + getLabels(locale, domainData.hasUI + "domain") .then(function(data){ $("#profileTxtDomain").append( labels.profileTxtDomain, @@ -142,7 +142,7 @@ function addDomainTitle(domainData, locale, labels) { function domainHtml(domainData, locale) { // add the different domains to a dropdown list - getLabels(locale, domainData.ui + "domain") + getLabels(locale, domainData.hasUI + "domain") .then(function(data) { $("#profileLstDomainItems").append( $.el.li( diff --git a/web/js/results.js b/web/js/results.js index 751dde8..29d2a05 100644 --- a/web/js/results.js +++ b/web/js/results.js @@ -64,8 +64,8 @@ function resultsInit() { domainSettings(domain) .then(function(domainData) { - ui = domainData.ui + "results"; - target = domainData.target; + ui = domainData.hasUI + "results"; + target = domainData.hasTarget; return getLabels(locale, ui); }) diff --git a/web/js/search.js b/web/js/search.js index 359cc8a..6436f7b 100644 --- a/web/js/search.js +++ b/web/js/search.js @@ -76,7 +76,7 @@ function populateUI() { // var domain = domainData.domain; // $.getJSON("ui_elements", // {locale:locale, -// ui:domainData.ui + "domain", +// ui:domainData.hasUI + "domain", // type:"labels"}) // .done(function(data){ // $("#domain" + row).append( @@ -87,7 +87,7 @@ function populateUI() { // $.el.img({'class':'domainImg', // 'id':'domainImg' + domain, // 'src':domainData.image}))); -// if(domainData.image_brightness === "dark") +// if(domainData.imageBrightness === "dark") // $("#domainTxt" + domainData.domain).css('color', '#fff'); // addDomainEvent(domain); // }); diff --git a/web/js/topic.js b/web/js/topic.js index 8f4c635..5415cbd 100644 --- a/web/js/topic.js +++ b/web/js/topic.js @@ -66,7 +66,7 @@ function topicHtml(topicData, row, locale) { console.log("Adding topic for ", topicData); // var domain = domainData.domain; // -// getLabels(locale, domainData.ui + "domain") +// getLabels(locale, domainData.hasUI + "domain") // .then(function(labels) { // $("#domain" + row).append( // $.el.div({'class':'noPadding col-md-6'}, @@ -75,9 +75,9 @@ function topicHtml(topicData, row, locale) { // labels.domainLabel), // $.el.img({'class':'domainImg', // 'id':'domainImg' + domain, -// 'src':domainData.image}))); +// 'src':domainData.hasDescriptiveImage}))); // -// if(domainData.image_brightness === "dark") +// if(domainData.imageBrightness === "dark") // $("#domainTxt" + domainData.domain).css('color', '#fff'); // // addDomainEvent(domain);