cnr-ibba / image-commondatapool Goto Github PK
View Code? Open in Web Editor NEWIMAGE Common Data Pool - PostgreSQL, metadata structure and data loading scripts
Home Page: https://api.image2020genebank.eu
License: Apache License 2.0
IMAGE Common Data Pool - PostgreSQL, metadata structure and data loading scripts
Home Page: https://api.image2020genebank.eu
License: Apache License 2.0
FAO has changed the interface for breed data sheet links and now the respective links in IMAGE Data Portal are broken. The change is: instead of the country name, country 3 letters code is used now, e.g. NLD instead of Netherlands:
The link in Image:
should be:
An entry with spaces in URLField
(such the dadis_url
attribute at https://api.image2020genebank.eu/backend/dadis_link/1/) doesn't render correctly URLs with encoded spaces in templates. This beaviour seems depends by the urlize
template tags, which is called in rest_framework/templates/rest_framework/base.html
to render a string formatted like this (not a JSON but a <pre>
formatted text):
{
"url": "http://localhost:26081/backend/dadis_link/1/",
"species": {
"scientific_name": "Ovis aries",
"common_name": "Sheep"
},
"supplied_breed": "Schoonebeek heath",
"country": "Netherlands",
"most_common_name": "Schoonebeeker Heideschaap",
"transboundary_name": "Schoonebeek heath sheep",
"other_name": [],
"dadis_url": "https://fao-dadis-breed-detail.firebaseapp.com/?country=Netherlands&specie=Sheep&breed=Schoonebeeker%20Heideschaap",
"is_custom": true
}
more precisely, urlize
cant represent the encoded space %20
in the href
link:
from django.utils.html import urlize
urlize("https://fao-dadis-breed-detail.firebaseapp.com/?country=Netherlands&specie=Sheep&breed=Schoonebeeker%20Heideschaap")
# '<a href="https://fao-dadis-breed-detail.firebaseapp.com/?country=Netherlands&specie=Sheep&breed=Schoonebeeker+Heideschaap">https://fao-dadis-breed-detail.firebaseapp.com/?country=Netherlands&specie=Sheep&breed=Schoonebeeker%20Heideschaap</a>'
The returned link (in which %20
is changed in +
) is not a valid dad-is permalink
Sending a query like https://api.image2020genebank.eu/backend/organism.geojson/?lat=10&lng=10&rad=10.1 cause Internal Server Error (500)
since getting an integer from float string throws an exception. Fix GeoMaterialMixin
to convert a string in a float
number (not a int
like this):
if rad:
# express radius in km
qs = qs.filter(distance__lte=int(rad)*1000)
Sometimes supplied_breed
breed doesn't match the FAO DAD-IS breed name. Adding a record in a table is not sufficient since process_fao_metadata.py
is able to operate over DAD-IS exported CSV file. Find a way to detect custom links between CDP supplied_breed
and DAD-IS breed
Biosamples records, like SAMEA7044752 have a 'externalReferences' key in which crosslinks with other EBI databases are reported. Try to track this information into database and API
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.