profile
viewpoint
Jörn Hees joernhees Germany http://joernhees.de Semantic Web, Linked Data, @RDFLib, data mining, machine learning

isaacs/github 1998

Just a place to track issues and feature requests that I have for github

joernhees/docker-virtuoso 4

Docker image to run a Virtuoso DB or import big RDF dumps into it.

joernhees/classicthesis 3

A fork of André Miede's LaTeX classicthesis template

joernhees/babel 1

The new official repository for Babel, the Python Internationalization Library

joernhees/configfiles 1

a couple of configuration files suited for development on a mac

joernhees/docker-dpkg-build 1

docker image to build .deb files from a link to a source tarball

joernhees/flask-appengine-template 1

Boilerplate project template for running Flask on Google App Engine

joernhees/aether 0

Aether VoID statistics tool

joernhees/associations 0

human associations and linked data research project website

issue commentdbpedia/ontology-tracker

Problem with DBPedia SPARQL endpoint

@openlink hi :) Have you been able to find out anything?

Also, I had posted another query to the forum which worked with the previous DBPedia endpoint and with other Virtuoso installations, but which seems to be broken on the latest Virtuoso used by the new DBPedia endpoint:

Virtuoso 37000 Error SP031: SPARQL compiler: The name ?_:anon_7_32 is used in multiple clauses, without any logical connection

SPARQL query:
#output-format:text/html
define sql:signal-unconnected-variables 1
define sql:signal-void-variables 1
define input:default-graph-uri <http://dbpedia.org>
          SELECT DISTINCT ?lc ?subj
          WHERE { { { { <http://dbpedia.org/ontology/Organisation> <http://www.w3.org/2000/01/rdf-schema#subClassOf>+ ?subj . } UNION { <http://dbpedia.org/ontology/Organisation> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>/<http://www.w3.org/2000/01/rdf-schema#subClassOf>* ?subj . }
          FILTER EXISTS { { ?subj <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Class> . } UNION { [ ] <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?subj . } UNION { ?subj <http://www.w3.org/2000/01/rdf-schema#subClassOf> [ ] . } } } }
          OPTIONAL { ?pLabel <http://www.w3.org/2000/01/rdf-schema#subPropertyOf>* <http://www.w3.org/2000/01/rdf-schema#label> . }
          OPTIONAL { { ?subj ?pLabel ?lc .
          FILTER ( LANGMATCHES( LANG( ?lc ), "" ) ) } UNION { ?subj ?pLabel ?lc .
          FILTER ( LANGMATCHES( LANG( ?lc ), "en" ) ) } } }
          LIMIT 2000

Could this be a bug in the latest Virtuoso version?

reckart

comment created time in an hour

issue commentRDFLib/rdflib

Namespace prefix is serialized to "ns1" despite binding it.

I think I found the issue: @base and @prefix point to the same URI, which it doesn't seem to like.

If I remove the base, it turns out correct. If I don't bind the namespace, it adds it as ns1, so the result is correct (though ugly). Just if I have both, it doesn't work.

Is this behaviour intended? If so, it should be documented.

BalduinLandolt

comment created time in 2 hours

issue commentRDFLib/rdflib

Leading digits in local part of prefixed names and `rdflib.Namespace`

The problem with what you are trying to do is that it is an illegal construct in the Python language itself.

NALT['28601'] will work, however.

tombaker

comment created time in 6 hours

issue openedRDFLib/rdflib

Leading digits in local part of prefixed names and `rdflib.Namespace`

According to RDF 1.1 Turtle, the local part of prefixed names may include leading digits. For example, http://lod.nal.usda.gov/nalt/286017 can be prefixed as nalt:286017. However, the rdflib Namespace mechanism does not handle this URI as expected:

>>> from rdflib import Namespace, Graph, RDFS
>>> NALT=Namespace("http://lod.nal.usda.gov/nalt/")
>>> g = Graph()
>>> g.parse('nalt.nt', format='nt')
<Graph identifier=Nc26a8583c0c14cb9b323bf7dc55375fe (<class 'rdflib.graph.Graph'>)>
>>> list(g.subject_objects(RDFS.label))
[(rdflib.term.URIRef('http://lod.nal.usda.gov/nalt/'), rdflib.term.Literal('NAL Thesaurus'))]
>>> list(g.predicates(NALT.28601))
  File "<ipython-input-24-460dbe57146e>", line 1
    list(g.predicates(NALT.28601))
                          ^
SyntaxError: invalid syntax

Is this a known issue (I couldn't find one here) and, if so, could it be fixed?

created time in 6 hours

created repositoryw3c/tdm-reservation-protocol

created time in 17 hours

startedEloston/ungoogled-chromium

started time in a day

startedmicrosoft/windows-rs

started time in a day

issue openedRDFLib/rdflib

Namespace prefix is serialized to "ns1" despite binding it.

Hi, sorry to bother and to double-post (this here), but the more I think about it, the less I think it's intended behaviour:

In the following minimal test case:

from rdflib import Graph, Namespace, Literal, RDF

base = "http://test.com/ns"
foobar = Namespace("http://test.com/ns#")
g = Graph(base=base)
g.bind('foobar', foobar)

g.add((foobar.something, RDF.type, Literal('Blah')))
g.add((foobar.something, foobar.contains, Literal('a property')))

g.add((foobar.anotherthing, RDF.type, Literal('Blubb')))
g.add((foobar.anotherthing, foobar.contains, Literal('another property')))

print(g.serialize(format='turtle').decode("utf-8"))

I get

@base <http://test.com/ns> .
@prefix foobar: <http://test.com/ns#> .

<#anotherthing> a "Blubb" ;
    ns1:contains "another property" .

ns1:something a "Blah" ;
    ns1:contains "a property" .

what I'd expecte is more like

@base <http://test.com/ns> .
@prefix foobar: <http://test.com/ns#> .

<#anotherthing> a "Blubb" ;
    foobar:contains "another property" .

<#something> a "Blah" ;
    foobar:contains "a property" .

So either there is something I fundamentally don't understand about RDFLib and how to use namespaces, or there's something funky going on.
ns1, not being defined in the beginning, can't be resolved correctly, right?
Also, I'm not clear, why <#anotherthing> refers to @base while ns1:something (in opposition to <#something>) refers to the @prefix foobar.

If you could tell me what I'm doing wrong, I'd be very grateful! But also, this might be an indication that the documentation on that part is not 100% clear. :)

created time in a day

startedfacebookresearch/faiss

started time in 2 days

issue commentRDFLib/rdflib-sqlalchemy

What is the license for this repo? Can you add a LICENSE file?

There's already a CONTRIBUTORS.md. I just changed the "Neither the name of..." part back to "the copyright holder" from the template on opensource.org

wondersmiths

comment created time in 2 days

create barnchRDFLib/rdflib-sqlalchemy

branch : issue-68-what-is-the-license

created branch time in 2 days

issue commentRDFLib/rdflib-sqlalchemy

What is the license for this repo? Can you add a LICENSE file?

Oh okay. According to the RDFLib licence, the magic words are:

Copyright (c) 2002-2020, RDFLib Team
See CONTRIBUTORS and http://github.com/RDFLib/rdflib
All rights reserved.

So I guess just changing the URL and adding a CONTRIBUTORS file would suffice.

wondersmiths

comment created time in 2 days

issue commentRDFLib/rdflib-sqlalchemy

What is the license for this repo? Can you add a LICENSE file?

@gjhiggins I refer back to that thing about me not being a lawyer, but I was thinking that it would be good to have the main developers just agree that they knowingly release the code they wrote under the BSD license. I guess there doesn't need to be an affirmative claim of ownership, but typically you'll see something like a list of authors in the copyright line in the license file.

@wondersmiths I mean the 3-clause BSD license, same as the main RDFLib lib up to a change in copyright holder names.

IDK if @adamhadani cares anymore. I'll make a LICENSE file, list y'all as copyright holders and make a PR. I'll leave it open until the weekend, so if anyone has a problem, they can speak up; otherwise, I'll merge it this weekend.

wondersmiths

comment created time in 2 days

issue commentRDFLib/rdflib-sqlalchemy

What is the license for this repo? Can you add a LICENSE file?

FTR, historically, this was something of an ad hoc contribution, it was floated as a sort of replacement for the old RDFLib 3 interface to Ian Bicking's SQLObject, this latter having gone out of scope a long time ago. IIRC there was little interest at the time and I just let it lie. Then Adam picked it up and spent quite a lot of effort breathing some life back into it. What's required for the “assert a copyright claim on their contributions and agree to the BSD license”? FWIW, I agree with wondersmith's suggestion of adding the RDFLib licence.

wondersmiths

comment created time in 2 days

issue commentRDFLib/rdflib-sqlalchemy

What is the license for this repo? Can you add a LICENSE file?

Thank you for your reply! It will be better to have the LICENSE file in the repository. BSD has different versions. Will you use the same term as RDFLib? https://github.com/RDFLib/rdflib/blob/master/LICENSE

wondersmiths

comment created time in 2 days

issue openedRDFLib/rdflib

SPARQLConnector does not work with AWS Neptune

  • Python 3.9.1
  • rdflib 5.0.0

code:

from rdflib.resource import Resource
from rdflib.namespace import SKOS, DCTERMS, XSD, RDFS

from rdflib.plugins.stores import sparqlstore

SPARQL_ENDPOINT = "https://dev-taxonomy-neptune-cluster.cluster-cab44ucmi0fe.us-east-1.neptune.amazonaws.com:8182/sparql"

store = sparqlstore.SPARQLUpdateStore(returnFormat='application/rdf+xml')
store.open((SPARQL_ENDPOINT, SPARQL_ENDPOINT))
store.bind("dcterms", DCTERMS)
ds = Dataset(store, default_union=True)

ds.add((DCTERMS.source, RDF.type, OWL.DatatypeProperty))

error:

  File "/Users/stephan.zednik/Projects/dhi/dhi-taxonomy-knowledge-graph-editor/example.py", line 15, in <module>
    ds.add((DCTERMS.source, RDF.type, OWL.DatatypeProperty))
  File "/usr/local/lib/python3.9/site-packages/rdflib/graph.py", line 1396, in add
    self.store.add((s, p, o), context=c, quoted=False)
  File "/usr/local/lib/python3.9/site-packages/rdflib/plugins/stores/sparqlstore.py", line 551, in add
    self.commit()
  File "/usr/local/lib/python3.9/site-packages/rdflib/plugins/stores/sparqlstore.py", line 527, in commit
    self._update('\n;\n'.join(self._edits))
  File "/usr/local/lib/python3.9/site-packages/rdflib/plugins/stores/sparqlstore.py", line 606, in _update
    SPARQLConnector.update(self, update)
  File "/usr/local/lib/python3.9/site-packages/rdflib/plugins/stores/sparqlconnector.py", line 124, in update
    res.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://dev-taxonomy-neptune-cluster.cluster-cab44ucmi0fe.us-east-1.neptune.amazonaws.com:8182/sparql

created time in 2 days

startedMellonScholarlyCommunication/Solid-Notifications

started time in 2 days

startedsolid/specification

started time in 2 days

PR opened RDFLib/rdflib

support headers in SPARQLConnector, allow urlencoding and take care of long uri's in commit

This is just something that came up while working with rdflib and the blazegraph db.

Currently any header that is set in the init is overwritten in the code. Simple checks whether there are headers in the self.kwargs prevents them from being overwritten with the default ones. In addition rdflib sets the postAsEncoded argument but newer uses it anywhere. I modified the SPARQLConnector so that updates can be POSTed via urlencoded uri's. A drawback is that the commit method must take care of too long uris and split the commit into several pieces.

Maybe these changes are redundant in sense that the maintainers choose to do updates differently(this seemed fixed https://github.com/RDFLib/rdflib/pull/315 and talked about here https://github.com/RDFLib/rdflib/pull/1175), but maybe its worth a discussion, again - if not just ignore this PR

+35 -9

0 comment

2 changed files

pr created time in 3 days

fork GillesVandewiele/best-of-ml-python

🏆 A ranked list of awesome machine learning Python libraries. Updated weekly.

https://ml-python.best-of.org

fork in 3 days

issue openedRDFLib/rdflib

5.0.0: test suitr is failing

======================================================================
FAIL: test.test_sparql_service.test_service
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/tkloczko/rpmbuild/BUILD/rdflib-5.0.0/test/test_sparql_service.py", line 20, in test_service
    assert len(results) == 2
AssertionError:
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: Starting new HTTP connection (1): dbpedia.org:80
urllib3.connectionpool: DEBUG: http://dbpedia.org:80 "GET /sparql?query=+select+%3FdbpHypernym+%3FdbpComment%0A++++where%0A++++%7B%0A++++%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FJohn_Lilburne%3E%0A++++++++%3Chttp%3A%2F%2Fpurl.org%2Flinguistics%2Fgold%2Fhypernym%3E+%3FdbpHypernym+%3B%0A++++++++%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23comment%3E+%3FdbpComment+.%0A%0A++++%7D+&output=json HTTP/1.1" 200 136
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test.test_sparql_service.test_service_with_bind
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/tkloczko/rpmbuild/BUILD/rdflib-5.0.0/test/test_sparql_service.py", line 42, in test_service_with_bind
    assert len(results) == 2
AssertionError:
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: Starting new HTTP connection (1): dbpedia.org:80
urllib3.connectionpool: DEBUG: http://dbpedia.org:80 "GET /sparql?query=+select+%3FdbpHypernym+%3FdbpComment+%3FdbpDeathPlace%0A++++where%0A++++%7B%0A++++%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FJohn_Lilburne%3E%0A++++++++%3Chttp%3A%2F%2Fpurl.org%2Flinguistics%2Fgold%2Fhypernym%3E+%3FdbpHypernym+%3B%0A++++++++%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23comment%3E+%3FdbpComment+%3B%0A++++++++%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FdeathPlace%3E+%3FdbpDeathPlace+.%0A%0A++++%7D+VALUES+%28%3FdbpDeathPlace%29+%7B%28%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FEltham%3E%29%7D&output=json HTTP/1.1" 200 153
--------------------- >> end captured logging << ---------------------

======================================================================
FAIL: test.test_sparql_service.test_service_with_values
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/tkloczko/rpmbuild/BUILD/rdflib-5.0.0/test/test_sparql_service.py", line 64, in test_service_with_values
    assert len(results) == 2
AssertionError:
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: Starting new HTTP connection (1): dbpedia.org:80
urllib3.connectionpool: DEBUG: http://dbpedia.org:80 "GET /sparql?query=+select+%3FdbpHypernym+%3FdbpComment+%3FdbpDeathPlace%0A++++where%0A++++%7B%0A++++%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FJohn_Lilburne%3E%0A++++++++%3Chttp%3A%2F%2Fpurl.org%2Flinguistics%2Fgold%2Fhypernym%3E+%3FdbpHypernym+%3B%0A++++++++%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23comment%3E+%3FdbpComment+%3B%0A++++++++%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FdeathPlace%3E+%3FdbpDeathPlace+.%0A%0A++++%7D+VALUES+%28%3FdbpHypernym+%3FdbpDeathPlace%29+%7B%28%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FLeveller%3E+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FLondon%3E%29%7D&output=json HTTP/1.1" 200 153
urllib3.connectionpool: DEBUG: Starting new HTTP connection (1): dbpedia.org:80
urllib3.connectionpool: DEBUG: http://dbpedia.org:80 "GET /sparql?query=+select+%3FdbpHypernym+%3FdbpComment+%3FdbpDeathPlace%0A++++where%0A++++%7B%0A++++%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FJohn_Lilburne%3E%0A++++++++%3Chttp%3A%2F%2Fpurl.org%2Flinguistics%2Fgold%2Fhypernym%3E+%3FdbpHypernym+%3B%0A++++++++%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23comment%3E+%3FdbpComment+%3B%0A++++++++%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FdeathPlace%3E+%3FdbpDeathPlace+.%0A%0A++++%7D+VALUES+%28%3FdbpHypernym+%3FdbpDeathPlace%29+%7B%28%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FLeveller%3E+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FEltham%3E%29%7D&output=json HTTP/1.1" 200 153
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 3231 tests in 28.250s

FAILED (failures=3, skipped=91)
Test failed: <unittest.runner.TextTestResult run=3231 errors=0 failures=3>
error: Test failed: <unittest.runner.TextTestResult run=3231 errors=0 failures=3>

created time in 4 days

startedgkoberger/stacksort

started time in 4 days

startedjevakallio/jest-clean-console-reporter

started time in 4 days

issue openedRDFLib/rdflib

Turtle de/serialize incorrectly interprets gYear

In 5.0.0, when a gYear is parsed and then re-serialised, from any format to any other format, RDFlib adds "-01-01" to the literal so, for example, "1982"^^xsd:gYear goes to "1982-01-01"^^xsd:gYear which is invalid.

Testing code:

from rdflib import Graph

data =  """
        PREFIX sdo: <https://schema.org/>
        PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

        <x:> sdo:startDate "1982"^^xsd:gYear .
        """

g = Graph().parse(data=data, format="ttl")
assert "1982-01-01" not in g.serialize(format="ttl").decode()


data2 = """<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:sdo="https://schema.org/"
>
  <rdf:Description rdf:about="x:">
    <sdo:startDate rdf:datatype="http://www.w3.org/2001/XMLSchema#gYear">1982</sdo:startDate>
  </rdf:Description>
</rdf:RDF>"""

g2 = Graph().parse(data=data2, format="xml")
assert "1982-01-01" not in g2.serialize(format="xml").decode()

created time in 4 days

startedexcalidraw/stats

started time in 4 days

fork lipis/lila

♞ lichess.org: the forever free, adless and open source chess server ♞

https://lichess.org

fork in 4 days

startedtypelevel/fs2-netty

started time in 4 days

startedveloce/lichobile

started time in 4 days

startedmdedetrich/akka-streams-json

started time in 5 days

more