Opened 12 months ago
Last modified 8 weeks ago
#46 reopened Feature request
Variant Namespaces Instead of MIME Type
Reported by: | Florian Berger | Owned by: | florian |
---|---|---|---|
Milestone: | Document Findings | Keywords: | |
Cc: |
Description (last modified by )
DE: Varianten: Namespace statt MIME-Typ
Varianten: statt MIME-Typ sowas wie Java/Android?-Namespaces: luna.html
, ext.rakewi.quiz
-> auch gleich API-Endpunkt-URL? /ext/
Change History (13)
comment:2 Changed 8 months ago by
The flow:
- HTTP
GET
request arrives - Decide content type to retrieve:
- If a specific mode is requested, use as content type
- Else check
Accept:
header - Else fall back to
text/html
- Try to retrieve content type from storage
- If content type is not available, fall back to
text/html
- If content type is not available, fall back to
comment:1 Changed 8 months ago by
Should we leave the MIME notation as is? I.e., use dots as delimiters, but not artificially split up fields?
luna.text/html.ar_SY
ext.org.example.user.audio/opus.fa_IR
This would also possibly give a hint as to where the domain might end.
comment:2 Changed 6 months ago by
Description: | modified (diff) |
---|---|
Type: | → Bug report |
comment:3 Changed 6 months ago by
>>> import icu >>> icu.Locale.create icu.Locale.createCanonical( icu.Locale.createFromName( icu.Locale.createKeywords( icu.Locale.createUnicodeKeywords( >>> icu.Locale.createFromName("de_DE") <Locale: de_DE> >>> str(icu.Locale.createFromName("de_DE")) 'de_DE' >>> str(icu.Locale.createFromName("de")) 'de' >>> icu.Locale.createCanonical("de_DE") <Locale: de_DE> >>> str(icu.Locale.createCanonical("de_DE")) 'de_DE' >>> str(icu.Locale.createCanonical("de")) 'de' >>> str(icu.Locale.createCanonical("fa_IR")) 'fa_IR' >>> str(icu.Locale.createCanonical("fa-IR")) 'fa_IR' >>> str(icu.Locale.createFromName("de")) 'de' >>> str(icu.Locale.createFromName("de").minimizeSubtags()) 'de' >>> str(icu.Locale.createFromName("de_DE").minimizeSubtags()) 'de' >>> str(icu.Locale.createFromName("en-US").minimizeSubtags()) 'en'
comment:4 Changed 6 months ago by
So.
- Variants will in principle be described using RDF.
- Minimum attributes are
dc:publisher
as a DNS domain- MIME-Type
- As on how to represent MIME in RDF, see the answer to "How to use MIME types for RDF typed literals"
dc:language
with a minimised CLDR language
- Variants may not be accessible by a dereferencable URI, so they will be referenced by their ID in a URN, such as
urn:luna:variant:contentID:variantID
- Minimum attributes are
- From the attributes, a dot-delimited string is constructed by the above methods. The string serves as the format identifier.
- It must be suitable for a Python
import
statement, i.e. obey the rules for Python package and module names. - The string may be used when requesting a mode from Luna, such as
http://host/courses/view/courseID/contentID?mode=formatID
- Since the mode string may be very long, verbose, and confusing to outsiders, a hash may be used instead. Currently the hash algorithm is SHA256. A prefix of the hash may be used as long as it is unique regarding the variants in the course.
- It must be suitable for a Python
comment:5 Changed 6 months ago by
I briefly considered using the Accept-Header as the content format, but this is basically just MIME, and supports no further attributes. A language request would be a separate Accept-Language header, and that would become a mess pretty quickly.
comment:7 Changed 6 months ago by
contrib seems to be a more verbose prefix than ext
.
See Django, git, OpenCV, PostgreSQL, Add a "contrib" directory to your projects
comment:8 Changed 6 months ago by
The Luna SQLite database does not store RDF.
This would lead to a possbily awkward duplication of data. Also, if semantic information would be kept in both columns and an RDF dump, how would Luna guarantee these are always in sync?
And if semantic information was exclusively kept in RDF records, then another query language and system would be needed on top of SQLite to retrieve the data. But a Luna storage backend should have a single API, not multiple.
But:
RDF should be easily retrievable from the database.
So probably a table is needed to map column names to URIs.
Consequences for variants:
- There will be a new table
formats
. - Columns:
id
– the dot-delimited string, foreign key forvariants.format
publisher
media_type
(MIME type)language
sha256
comment:9 Changed 6 months ago by
Milestone: | Demo Course – Features → Mode Menu – Features |
---|---|
Owner: | set to florian |
Status: | new → accepted |
Type: | Bug report → Feature request |
comment:10 Changed 6 months ago by
Resolution: | → Fixed |
---|---|
Status: | accepted → closed |
Implemented in d9dce7106a73a3eb3a7d0ae42fc99ac5dcf6dbd857fbbe3f3ae0ca633e4e0978 (Fossil) / 14b8ff06 (GitLab).
comment:11 Changed 8 weeks ago by
Milestone: | Mode Menu – Features → Document Findings |
---|---|
Resolution: | Fixed |
Status: | closed → reopened |
icu::Locale Class Reference: minimizeSubtags()