Skip to content

Select command and some small fixes#1

Open
sirex wants to merge 7 commits intorrasmo:masterfrom
sirex:master
Open

Select command and some small fixes#1
sirex wants to merge 7 commits intorrasmo:masterfrom
sirex:master

Conversation

@sirex
Copy link

@sirex sirex commented Jan 2, 2015

For better descriptions on changes see commit message of each change.

Check if given ref is actually a URIRef, before trying to normalize it.
Eventually this code should be migrated to Python 3, so using unicode_literals
is a good start.
Here, Model.load was monkey patched globally and running all tests gives this
error:

    ======================================================================
    FAIL: test_load_local_file (test.test_model.TestModel)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    t/test_model.py|25| in test_load_local_file
        self.assertEqual(len(self.model.graph), 213)
    AssertionError: 7 != 213

So instead of monkey patching Model class, I just created FakeModel with
overridden `load` method. After this, all tests pass:

    $ nosetests test
    ........................
    ----------------------------------------------------------------------
    Ran 24 tests in 0.777s

    OK
With this change it is possible to query active graph with SPARQL SELECT query,
like this:

    > http://www.w3.org/ns/dcat> select distinct ?o where { ?s rdfs:label ?o . filter(lang(?o) = "") }
    +------------------------------+
    | o                            |
    +------------------------------+
    | Download (Deprecated)        |
    | granularity (Deprecated)     |
    | data quality (Deprecated)    |
    | data dictionary (Deprecated) |
    | size (Deprecated)            |
    | Web Service (Deprecated)     |
    | size in bytes (Deprecated)   |
    | Feed (Deprecated)            |
    +------------------------------+
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.

1 participant