Skip to content
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

Why does typeof work only with CURIEs? #8

Open
melvincarvalho opened this issue Oct 10, 2014 · 5 comments
Open

Why does typeof work only with CURIEs? #8

melvincarvalho opened this issue Oct 10, 2014 · 5 comments

Comments

@melvincarvalho
Copy link

I'd like to be able to use full URLs

Tested with rapper

Code reference:

else if(strcmp(attr, "typeof") == 0)

@dlongley
Copy link
Contributor

If you look at the other code paths, they are all calling rdfa_resolve_curie or rdfa_resolve_curie_list; those functions handle full URLs or CURIEs.

But, regardless, if you drill down into the code you'll get to this bit:

if(expanded_prefix == NULL && strstr(uri, ":") != NULL &&

Which will generate a warning for a URL without "://" and an undefined prefix in the context -- but that's merely a warning. Then the code heads down here:

/* if we're NULL at this point and the IRI isn't [], then this might be

Which will fail the first conditional if you have a colon -- and fall into the second one, which will fail because the parse mode for typeof (CURIE_PARSE_INSTANCEOF_DATATYPE) isn't supported there.

So -- if you're getting a failure with a full URL for typeof, it looks like that might be culprit. I would have expected a full URL to work for typeof as well, but I didn't check the spec.

cc: @msporny

dlongley added a commit that referenced this issue Oct 10, 2014
@dlongley
Copy link
Contributor

This should work now. I noticed that the xhtml1-rdfa1.1 test suite doesn't have a typeof example with a full URL -- so that needs updating.

@msporny
Copy link
Contributor

msporny commented Oct 10, 2014

Hey @melvincarvalho - great spot on that bug and @dlongley has added a fix for it.

That said, it's been difficult to keep that library up to date w/ the latest test suite (many more tests have been added to the test suite in a variety of different languages and librdfa doesn't do well with a few of those new tests). Granted, many of the new tests are corner cases, but a failed test is a failed test. I wouldn't depend on rapper to generate proper rdfa output - you will want to cross-check against a library that is more actively maintained (Gregg Kellogg's implementation, for example).

It's a matter of time and priorities. We could fix up librdfa, but it doesn't really buy our company anything since we're planning on dropping all support for RDFa (in favor of JSON-LD).

@melvincarvalho
Copy link
Author

Awesome guys! I added a vocab term and rapper then passes. I was just using a standard rapper -g for testing. My normal (boring) way to mark things up is just to use full URLs. Great work on solving this so fast!

@dlongley
Copy link
Contributor

It's a matter of time and priorities. We could fix up librdfa, but it doesn't really buy our company anything since we're planning on dropping all support for RDFa (in favor of JSON-LD).

That being said, it's open source: PRs FTW!

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

No branches or pull requests

3 participants