gbv / bartoc.org Goto Github PK
View Code? Open in Web Editor NEWSource code of BARTOC.org user interface
Home Page: https://bartoc.org/
Source code of BARTOC.org user interface
Home Page: https://bartoc.org/
See http://bartoc.org/vocabularies?subject=https%3A//bartoc.org/ILC/1/V-general-class: the subject is used for filtering but the filter is not shown in the subject editor to filter by ILC class.
Filter vocabularies by access mode
Requires a method to mint a new URI. Best solution so far might be
Format and Access types are shown with their global BARTOC URI but the links should be turned into local links to keep browsing in the current instance. Should be solved together with #29.
Full minimized boostrap is still 142kB
Originally at https://bartoc.org/en/top-rated-points and listed in the navbar
The list of vocabularies should show more than the vocabulary name.
The current BARTOC interface is usable in many languages. Can we keep this?
When running npm run cache
, I get the error Can't locate JSON.pm in @INC (you may need to install the JSON module)
. The documentation should describe how to install the necessary Perl dependencies.
BARTOC should allow to filter for FAIR vocabularies. This requires
Open questions: does a FAIR vocabulary require resolvable URIs or is it possible to have other means of resolving (e.g. lookup in the documentation). Is machine-readable vocabulary content a requirement for a FAIR vocabulary? Without more clear definition of FAIR is its hard to get the information about FAIRness into BARTOC. By now we collect information about;
Is this enough to decide whether a vocabulary is FAIR?
Page https://bartoc.org/en/title-finder provided a simple search for to search by title only. Do we need this when #27 is solved?
Otherwise the full page is a Vue App, showing in empty page if something fails.
A lot of statistics (growth over time, vocabularies by country etc...) can be generated from the daily dumps. What kind of statistics are useful?
Update the list of vocabularies when search form is modified without having to send the form.
Requires a backend with write capabilities
e.g. physical formats, RDF-based formats...
and provide link to archived page
Above the footer
Original BARTOC supported filter vocabularies by location country
Browsing and searching in vocabularies such as implemented at http://uri.gbv.de/terminology/bk/ should be added client side.
If a vocabulary is available in Cocoda, a link should be shown to open Cocoda with the vocabulary. E.g. at http://bartoc.gbv.de/en/node/18785 a link should be added to https://coli-conc.gbv.de/cocoda/app/?fromScheme=http%3A%2F%2Fbartoc.org%2Fen%2Fnode%2F18785. The link can be added dynamically via JavaScript.
The application will be hostet at https://bartoc.org/ but the login server is at https://coli-conc.gbv.de/login/ so it won't work when third party-cookies are disabled (should be the default on modern browsers). Possible solutions?
See also gbv/login-client#10 (documentation) and gbv/login-server#9 (previous discussion)
Requires gbv/cocoda#522 in the long run. Prototype can be created by implementing a subset to access and search concept schemes and concepts.
Basically https://github.com/gbv/kos-registry could be reduced, no?
By now topics (DDC and EuroVoc) are only shown with their URI. For client-side rendering we might use cocoda-sdk (when gbv/cocoda-sdk#15 has been implemented). For more reliable access we should import DDC, EuroVoc and ILC into the bartoc jskos-server instance.
The CDN seems slow sometimes and less dependencies is better.
Could be done with a bot or as part of the edit form:
var locid = (scheme.identifier||[]).find(id => id.startsWith("http://id.loc.gov/vocabulary/classSchemes/"))
if (locid && !scheme.MARCSPEC) {
scheme.MARCSPEC = '084{$2='+locid.substr(42)+'}'
}
For more flexible querying its seems better to cache vocabularies in a jskos-server instance (or in a flat file) instead of passing all queries to DANTE API.
Items may contain additional fields such as CONTACT. The editor should keep track of these fields too.
Requires gbv/jskos-server#115
Requires a backend with search capabilities. See gbv/jskos-server#43 for jskos-server.
Use Vue with SSR so we don't need two different template systems.
Subject with URI = "" should be filtered out.
❯ npm run cache
> [email protected] cache /Users/stefan/repos/gbv/bartoc.org
> mkdir -p cache; npm run cache:nkostype; cd bin; make
> [email protected] cache:nkostype /Users/stefan/repos/gbv/bartoc.org
> curl http://api.dante.gbv.de/voc/nkostype/top | jq -c .[] > cache/nkostype.ndjson
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16744 0 16744 0 0 61520 0 --:--:-- --:--:-- --:--:-- 61558
./vocabularies2jskos.pl < ../data/vocabularies-dump.ndjson > ../cache/vocabularies.ndjson
npm run validate -- -v scheme
> [email protected] validate /Users/stefan/repos/gbv/bartoc.org
> jskos-validate "-v" "scheme"
The script gets stuck here indefinitely.
The full list of vocabularies can be accessed via JSKOS API (with limit
large enough). Nevertheless we should provide daily dumps, also to better track changes. There could be a latest
pointer and old dumps kept only when something was changed. Dumps should also be normalized and sorted by URI.
curl 'http://localhost:3883/api/voc?limit=5000' | jq -cS 'sort_by(.uri)|.[]' > latest.ndjson
licenses and nkostypes should be retrieved when the server is started instead of having to run an initialization step before.
Original BARTOC supported filter vocabularies by format
Originally at https://bartoc.org/en/tracker and listed in the navbar
{
"url": "/tracker",
"prefLabel": { "en": "Recent content" }
}
The language of non-English abstract is always stored as "und". Better allow to set an explicit language tag. Language could also be detected e.g. by trigram statistics.
For example in http://bartoc.gbv.de/vocabularies?uri=http%3A%2F%2Fbartoc.org%2Fen%2Fnode%2F18929, I added the notation pattern FID-[A-Z]+
, which is shown as "Namespace". In the edit screen, it is correctly shown though.
Drual-based implementation, should be changed to Vue
/**
* Get Wikidata URI, query corresponding Wikipedia links and inject into page.
*/
(function ($) {
"use strict";
// get Wikidata URI
var item = $('.field-name-field-wikidata a[href^="http://www.wikidata.org/entity/"]').attr('href');
// inject list of sitelinks into HTML page
function inject_sitelinks(links) {
if (!$.isArray(links) || !links.length) return;
var fieldName = 'field-name-field-wikipedia-urls';
$('.field-name-field-wikidata').after('<div class="field '+fieldName+' field-type-taxonomy-term-reference field-label-inline clearfix"></div>');
$('.'+fieldName).append('<div class="field-label">Wikipedia: </div');
$('.'+fieldName).append('<div class="field-items"></div');
$.each(links, function(i, link){
var url = link.url;
var lang = link.lang;
var parity = i % 2 ? 'even' : 'odd';
$('.'+fieldName+' > .field-items').append('<div class="field-item '+parity+'"><a href="'+url+'" class="ext" target="_blank">'+lang+'</a></div>');
$('.'+fieldName+' > .field-items > .field-item > a').css({'color':'#3F5E70','border':'1px solid #3F5E70','background':'#FFF'});
});
};
// perform query
var api = "https://query.wikidata.org/bigdata/namespace/wdq/sparql";
var sparql = "PREFIX schema: <http://schema.org/>\n"
+ "SELECT * { ?url schema:about <"+item+">; schema:inLanguage ?lang }";
$.ajax({
url: api,
data: { format: 'json', query: sparql },
success: function(data) {
inject_sitelinks(
$.map(data.results.bindings, function(row) {
return { url: row.url.value, lang: row.lang.value }
})
);
},
});
// TODO (MAYBE): nicer links
// - get names of projects via
// https://www.wikidata.org/w/api.php?action=sitematrix
// - get names of languages (how?)
})(jQuery);
Have URLs such as
/en/DDC-Class/Arts-and-Recreation
/en/DDC-Class/General-works-Computer-science-and-Information
/en/DDC-Class/History-and-Geography
/en/DDC-Class/Language
/en/DDC-Class/Literature
/en/DDC-Class/Pure-Science
/en/DDC-Class/Social-sciences
/en/DDC-Class/Technology
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.