Giter Site home page Giter Site logo

Comments (2)

WhiteGobo avatar WhiteGobo commented on June 2, 2024

As a workaround you can write your second prefix directly into the default memory store.

from rdflib import Graph, Namespace, URIRef
EX = Namespace("http://example.org/")
g = Graph(bind_namespaces="none")
g.bind("ex", EX)
g.store._Memory__namespace["ex1"] = URIRef("http://example.org/")
print(list(g.namespaces()))
#[('ex', rdflib.term.URIRef('http://example.org/')), ('ex1', rdflib.term.URIRef('http://example.org/'))]

I havent tested this any further. So dont know if there will be any problems or other stores will behave in the same manner.

from rdflib.

nicholascar avatar nicholascar commented on June 2, 2024

The base issue could be a real one and I will look into it when I'm back from holidays in a few weeks.

But the multi prefixes one is not! Sure, it's not a violation to want to have multiple prefixes for the same namespace and you do see it in data but prefixes are just presentation conveniences and I think that too much catering for every possible use of them overemphasises their role. They are not real data things and a single prefix for a namespace will always work, even when multiple are originally supplied in the data, or defined as per your code above.

So I'm not motivated to solve this one. And there is indeed a work around.

If it's really important to you, @hsekol-hub, please feel free to create a Pull Request to address it yourself.

from rdflib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.