Giter Site home page Giter Site logo

Comments (6)

joachimvh avatar joachimvh commented on June 26, 2024 2

The default rating for HTML in the RDF parser is 0.2, but turns out we are just using the type names without the values. So changing that in CSS would probably already fix the problem.

from communitysolidserver.

thhck avatar thhck commented on June 26, 2024

see also #1804

from communitysolidserver.

joachimvh avatar joachimvh commented on June 26, 2024

This is a consequence of our content negotiation being too helpful. The server can convert from markdown to HTML, which makes sense. It can also convert HTML to RDF since HTML is a valid RDF format with RDFa. So the server goes through those steps to return the result that was requested, even though that results in an empty document as the original markdown did not contain RDFa tags.

The main solution is to not request turtle when you want to have markdown. I'll have to see if there is something we can do server-side to prevent this issue.

from communitysolidserver.

Vinnl avatar Vinnl commented on June 26, 2024

The main solution is to not request turtle when you want to have markdown.

For some context on the Penny side, that's not really possible. Penny doesn't know in advance what content type it "wants", as it's just following links in the Pod. So really it just wants the type that's most relevant to the user for the given data (usually the content type as it was sent to the server), tie-breaking to Turtle if the resource is properly representable as RDF (hence Accept: text/turtle;q=1.0, /;q=0.5), which ideally only happens if that representation is lossless. So yeah, agreed that the server is probably too helpful here, as the RDF conversion discards information.

(I actually think converting RDFa to other RDF serialisations is often problematic for the same reason, i.e. it being a lossy conversion. Possibly, an idea would be to only do that if the Accept header explicitly does not accept text/html? Or even to never convert it on the server, and let the client handle that if it so desires.)

from communitysolidserver.

RubenVerborgh avatar RubenVerborgh commented on June 26, 2024

can also convert HTML to RDF

That conversion is lossy indeed, so the server should (and as far as I remember, does) assign it an internal quality of less than 1.

And then it just comes down to multiplication of qualities.

If the server (by whatever process) determines the quality of its Turtle for this resource to be 0.7, then the quality list becomes:

  • Turtle: 0.7
  • Markdown: 0.5
  • HTML: 0.5

tie-breaking

Definitely recommend Penny to upgrade the q=0.5 to something closer to q=0.9 in any case; that allows more freedom for servers.

from communitysolidserver.

Vinnl avatar Vinnl commented on June 26, 2024

Definitely recommend Penny to upgrade the q=0.5 to something closer to q=0.9 in any case; that allows more freedom for servers.

Oh that's a good tip, I'll do that, thanks!

Edit: oh wait, I misread it as turning the 1.0 down to 0.9, just to make it not that maximum value. Aren't the values otherwise arbitrary? I wouldn't expect any behavioural differences between 1.0 and 0.5 vs 1.0 and 0.9, since the relative priority is still the same?

from communitysolidserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.