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

Include Concise Bounded Description example in the tests for Graph.cbd #1914

Closed
aucampia opened this issue May 12, 2022 · 2 comments · Fixed by #1915
Closed

Include Concise Bounded Description example in the tests for Graph.cbd #1914

aucampia opened this issue May 12, 2022 · 2 comments · Fixed by #1915
Labels

Comments

@aucampia
Copy link
Member

From a brief glance at Graph.cbd I'm unsure if it will be able to reproduce the example from the Concise Bounded Description definition, but regardless this example should be included in our tests so we can be sure it passes.

@ms1901
Copy link

ms1901 commented May 12, 2022

Hello @aucampia,
I am working on solving this.

@ghost
Copy link

ghost commented May 12, 2022

From a brief glance at Graph.cbd I'm unsure if it will be able to reproduce the example from the Concise Bounded Description definition, but regardless this example should be included in our tests so we can be sure it passes.

Yes Graph.cbd() does reproduce the example (I've elided the actual RDF/XML inputgraph and expectedgraph data) as far as isomorphic is concerned ...

def testcbd_example():

    g = Graph()
    g.parse(data=inputgraph, format="xml")

    result = g.cbd(URIRef("http://example.com/aReallyGreatBook"))
    expected = Graph().parse(data=expectedgraph, format="xml")

    assert isomorphic(result, expected)

And I can confirm the test result via using my implementation of the DigitalBazaar URDNA canonicalizer:

    canonicalized_expected = expected.serialize(format="rdna")
    canonicalized_result = result.serialize(format="rdna")

    assert canonicalized_expected == canonicalized_result

So Graph.cbd() seems to be working as one would expect.

aucampia pushed a commit that referenced this issue May 13, 2022
We have added a test for the example at the definition for Concise Bounded Definition [here](https://www.w3.org/Submission/CBD/#example).

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

Successfully merging a pull request may close this issue.

2 participants