Skip to content

Split out RDFa code from jsonld.js. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Split out RDFa code from jsonld.js. #1

wants to merge 3 commits into from

Conversation

davidlehn
Copy link
Member

No description provided.

@davidlehn davidlehn requested a review from dlongley December 6, 2019 22:04
@gkellogg
Copy link

gkellogg commented Dec 6, 2019

If this package includes an HTML parser (or at least a reasonable XML parser), perhaps it's the package for testing the HTML bits of JSON-LD?

Otherwise, I was considering some form of dependency injection so that jsonld.js can be compatible with HTML script extraction if a suitable HTML/XML library is present or otherwise injected.

@davidlehn
Copy link
Member Author

I hadn't been thinking of how to do the HTML script code. This patch was partially to remove the xmldom dependency from jsonld.js itself. Maybe that will need to stay around somehow at least for testing. Should consider how that HTML script support works before this is split out in case there's a better overall design.

@gkellogg
Copy link

gkellogg commented Dec 7, 2019

Yeah, I’ll work on that next. It’s entirely limited to the document loader

Copy link
Member

@dlongley dlongley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! I suggest using a more generic BSD-3 style license instead of copying the one from jsonld.js.

@dlongley
Copy link
Member

dlongley commented Dec 7, 2019

@gkellogg,

Yeah, I’ll work on that next. It’s entirely limited to the document loader

We should put the HTML stuff in a separate package so if it isn't needed, it doesn't have to be pulled in. Something like jsonld-html ... @davidlehn -- if you agree with that direction and naming, could you make that package and work with @gkellogg?

Perhaps we could install that package as a dev dependency for jsonld.js so we can test in one place if it helps.

@gkellogg
Copy link

gkellogg commented Dec 7, 2019

I figured that's where we could go. We could either condition the built-in documentLoader on if xmldom (or similar) is loaded, or do a special-purpose documentLoader within that package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants