Recipes icon indicating copy to clipboard operation
Recipes copied to clipboard

Auxiliary resources not recognized as `text/turtle` when using `options_enabledMediaRanges`

Open bourgeoa opened this issue 11 months ago • 3 comments

When running CSS with mashlib using

       "options_enabledMediaRanges": [
          "text/turtle",
          "text/n3",
          "text/markdown",
          "application/ld+json",
          "application/json",
          "application/rdf+xml"
        ]

Url containing auxiliary ressources like .acl or .meta are not recognized as text/turtle and rendered in mashlib.

  • .meta is just displayed in browser as plain text
  • .acl displays a page with not logged in

bourgeoa avatar Feb 20 '25 10:02 bourgeoa

I tried it out and .acl worked for me, so the not logged in error makes me think the request does not have control access on the resource.

But for .meta this does not work indeed, as the server internally just interprets these as quads, and not a specific content-type. The internal type that is used to represent quad objects is internal/quads. Can you see if adding that to the list solves your problem?

joachimvh avatar Feb 21 '25 07:02 joachimvh

But for .meta this does not work indeed, as the server internally just interprets these as quads, and not a specific content-type. The internal type that is used to represent quad objects is internal/quads. Can you see if adding that to the list solves your problem?

yes this solve the problem. But it is quite a funny content-type When going to the console dev on network content-type appears as text/turtle

bourgeoa avatar Feb 21 '25 10:02 bourgeoa

I tried it out and .acl worked for me, so the not logged in error makes me think the request does not have control access on the resource.

It does not work for me you could try at https://solidcommunity.net:3000 a pure CSS with subdomain by creating an account. There is no issue to edit the /.acl from inside mashlib using the acl-pane.

root@solidcommunity:/mnt/volume_lon1_01/test-css-subdomain# cat bourgeoa/.acl
@prefix : </.acl#>.
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix bou: </>.
@prefix c: </profile/card#>.

:ControlReadWrite
    a acl:Authorization;
    acl:accessTo bou:;
    acl:agent c:me, <mailto:[email protected]>;
    acl:default bou:;
    acl:mode acl:Control, acl:Read, acl:Write.
:Read
    a acl:Authorization;
    acl:accessTo bou:;
    acl:agentClass foaf:Agent;
    acl:default bou:;
    acl:mode acl:Read.

If any help here are the parameters used for CSS.

# cat ../css-config/subdomain-mashlib-v7.json
{
  "@context": [
    "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^7.0.0/components/context.jsonld"
  ],
  "import": [
    "css:config/app/init/default.json",
    "css:config/app/main/default.json",
    "css:config/app/variables/default.json",
    "css:config/http/handler/default.json",
    "css:config/http/middleware/default.json",
    "css:config/http/notifications/all.json",
    "css:config/http/server-factory/https.json",
    "css:config/http/static/default.json",
    "css:config/identity/access/public.json",
    "css:config/identity/email/example.json",
    "css:config/identity/handler/default.json",
    "css:config/identity/oidc/default.json",
    "css:config/identity/ownership/token.json",
    "css:config/identity/pod/static.json",
    "css:config/ldp/authentication/dpop-bearer.json",
    "css:config/ldp/authorization/webacl.json",
    "css:config/ldp/handler/default.json",
    "css:config/ldp/metadata-parser/default.json",
    "css:config/ldp/metadata-writer/default.json",
    "css:config/ldp/modes/default.json",
    "css:config/storage/backend/pod-quota-file.json",
    "css:config/storage/key-value/resource-store.json",
    "css:config/storage/location/pod.json",
    "css:config/storage/middleware/default.json",
    "css:config/util/auxiliary/acl.json",
    "css:config/util/identifiers/subdomain.json",
    "css:config/util/logging/winston.json",
    "css:config/util/representation-conversion/default.json",
    "css:config/util/resource-locker/memory.json",
    "css:config/util/variables/default.json"
  ],
  "@graph": [
    {
      "comment": "The settings of your email server.",
      "@type": "Override",
      "overrideInstance": {
        "@id": "urn:solid-server:default:EmailSender"
      },
      "overrideParameters": {
        "@type": "BaseEmailSender",
        "senderName": "[email protected]",
        "emailConfig_host": "smtp.sendgrid.net",
        "emailConfig_port": 465,
        "emailConfig_auth_user": "apikey",
        "emailConfig_auth_pass": "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"
      }
    },
    {
      "comment": "The location of the new pod templates folder.",
      "@type": "Override",
      "overrideInstance": {
        "@id": "urn:solid-server:default:PodResourcesGenerator"
      },
      "overrideParameters": {
        "@type": "StaticFolderGenerator",
        "templateFolder": "/home/solid/test-css/templates/pod"
      }
    },
      {
        "comment": "Sets the maximum size of a single pod to 50MB.",
        "@type": "Override",
        "overrideInstance": {
            "@id": "urn:solid-server:default:QuotaStrategy"
        },
        "overrideParameters": {
            "@type": "PodQuotaStrategy",
            "limit_amount": 50000000,
            "limit_unit": "bytes"
        }
      },
    {
      "comment": "Where the WebID is located in the generated pod, relative to the root.",
      "@type": "Override",
      "overrideInstance": {
        "@id": "urn:solid-server:default:PodCreator"
      },
      "overrideParameters": {
        "@type": "BasePodCreator",
        "relativeWebIdPath": "profile/card#me"
      }
    },
    {
      "comment": [
        "A filesystem-based server with Databrowser as UI.",
        "Derived from config/file-no-setup.json"
      ]
    },
    {
      "comment": "Serve Databrowser as default representation",
      "@id": "urn:solid-server:default:DefaultUiConverter",
      "@type": "ConstantConverter",
      "contentType": "text/html",
      "filePath": "./node_modules/mashlib/dist/databrowser.html",
      "options_container": true,
      "options_document": true,
      "options_minQuality": 1,
        "options_enabledMediaRanges": [
         "text/turtle",
         "text/n3",
         "text/markdown",
         "application/ld+json",
         "application/json",
         "application/rdf+xml",
         "internal/quads"
       ]
     },
    {
      "comment": "Serve Mashlib static files.",
      "@id": "urn:solid-server:default:StaticAssetHandler",
      "@type": "StaticAssetHandler",
      "assets": [
        {
          "@type": "StaticAssetEntry",
          "relativeUrl": "/browse.html",
          "filePath": "./node_modules/mashlib/dist/browse.html"
        },
        {
          "@type": "StaticAssetEntry",
          "relativeUrl": "/mash.css",
          "filePath": "./node_modules/mashlib/dist/mash.css"
        },
        {
          "@type": "StaticAssetEntry",
          "relativeUrl": "/mashlib.min.js",
          "filePath": "./node_modules/mashlib/dist/mashlib.min.js"
        },
        {
          "@type": "StaticAssetEntry",
          "relativeUrl": "/mashlib.min.js.map",
          "filePath": "./node_modules/mashlib/dist/mashlib.min.js.map"
        }
      ]
    }
  ]
}

bourgeoa avatar Feb 21 '25 10:02 bourgeoa