For FEP-888d I would like to request any comments on blockers, objections, etc. – for example, are there any mappings that one would expect to work, that don’t currently work?
The .htaccess is below for convenience (some changes as I test them):
Header set Access-Control-Allow-Origin *
Header set Access-Control-Allow-Headers DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified$
Options +FollowSymLinks
RewriteEngine on
# catch FEP-specific context requests
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^([A-Za-z0-9]+)\/?(.*?)?$ https://codeberg.org/fediverse/fep/src/branch/main/fep/$1/context.jsonld [R=302,L]
# catch FEP-specific context requests without content negotiation
RewriteRule ^([A-Za-z0-9]+).jsonld$ https://codeberg.org/fediverse/fep/src/branch/main/fep/$1/context.jsonld [R=302,L]
# catch FEP proposal documents
RewriteRule ^([A-Za-z0-9]+)\/?$ https://codeberg.org/fediverse/fep/src/branch/main/fep/$1/fep-$1.md [R=302,L]
# a generic catch-all rule
RewriteRule ^(.*)\/?$ https://codeberg.org/fediverse/fep/src/branch/main/fep/$1 [R=302,L]
I’m currently trying to put together some test cases in Python and have the following mappings:
{
"fep": "http://localhost/fep/", # this redirects twice basically, due to a quirk of apache
"fep/": "https://codeberg.org/fediverse/fep/src/branch/main/fep/",
"fep/xxxx": "https://codeberg.org/fediverse/fep/src/branch/main/fep/xxxx/fep-xxxx.md",
"fep/xxxx/": "https://codeberg.org/fediverse/fep/src/branch/main/fep/xxxx/fep-xxxx.md",
"fep/xxxx.jsonld": "https://codeberg.org/fediverse/fep/src/branch/main/fep/xxxx/context.jsonld",
"fep/xxxx/asset.jpg": "https://codeberg.org/fediverse/fep/src/branch/main/fep/xxxx/asset.jpg"
}
This should support both IRIs of the form https://w3id.org/fep/xxxx/someTerm
(to be defined in a plaintext file/asset, ideally) as well as IRIs of the form https://w3id.org/fep/xxxx#someTerm
(to be defined ideally under a section of the FEP’s markdown file given an anchor of #someTerm
). Furthermore, it supports importing FEPs singularly, as well as submitting an FEP that imports from other FEPs into its own context.jsonld
If there are no comments, changes, objections, etc. then I will update the FEP with the final .htaccess and request finalization. If/when the FEP goes FINAL, I will submit the PR to the w3id PURL service’s Github repo.
The intended way to define context.jsonld is explained in this FEP but if there are any clarifications or points of confusion, I can clarify those as well. See FEP-bad1 or FEP-a070 for examples
The option also remains open for anyone to use their own namespaces – see for example FEP-c648 which uses https://purl.archive.org/socialweb/blocked#blocked
but could also potentially provide its own context.jsonld which would allow using https://w3id.org/fep/c648
to resolve and define like so:
{
"@context": {
"blocked": {
"@id": "https://purl.archive.org/socialweb/blocked#blocked",
"@type": "@id"
}
}