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

first version of tests for expected RDF #32

Closed
wants to merge 12 commits into from

Conversation

elf-pavlik
Copy link
Member

it addresses #17

not fully ready to merge but i would like to get some feedback, and discuss travis-ci integration
you can test it by running from root of the repository

$ npm install
$ npm test

i could also setup separate repository and run those tests independently!

@elf-pavlik
Copy link
Member Author

now tests expect latest version of spec currently at gh-pages, i still need to fix then to fail properly... also will switch to turtle soon for expected RDF

var getExample = function(name) {
if (!examples[name]) {
examples[name] = JSON.parse(doc('#' + name + ' pre.example').text());
examples[name]['@context'] = CONTEXT;
Copy link
Member

Choose a reason for hiding this comment

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

I think instead of modifying the examples, it would be better to inject the context as expandContext option in the toRDF call. If you do it this way and a context already exists in the example, you'll overwrite it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@lanthaler thx! changed in 6f8c84d

Copy link
Member

Choose a reason for hiding this comment

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

Great work @elf-pavlik Would be interessting to check whether we can also leverage this to convert the examples in the Hydra spec to Turtle.

@elf-pavlik
Copy link
Member Author

fixed! i think i tired it that way since JSON-LD Playground gives me bunch of triples from OWL definitions if i just paste context there. anyways looks fine here :)
BTW i converted NQuads to Turtle manually, may need to post to rdfjs mailing list later today about comparing triples we'll get from JSON-LD examples and expected Turtle fixtures...

@elf-pavlik
Copy link
Member Author

thanks to @bergos work on rdf-interfaces and rdf-ext we have clean way to compare examples in JSON-LD with expected RDF in Turtle fixtures!

tests run and pass after merging on master branch!

i still can tidy up code with some re factoring and add tests for more examples

@elf-pavlik
Copy link
Member Author

I'll make new PR which automatically compares JSON-LD, RDFa and Turtle from examples.

@elf-pavlik elf-pavlik closed this Jan 18, 2015
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.

None yet

2 participants