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

Provide means to expand a CURIE #626

Closed
rob-metalinkage opened this issue May 11, 2016 · 6 comments
Closed

Provide means to expand a CURIE #626

rob-metalinkage opened this issue May 11, 2016 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed serialization Related to serialization.

Comments

@rob-metalinkage
Copy link

NamespaceManager has a normalizeUri method to create a CURIE (short form like foaf:Person) but no obvious way to do the inverse create a valid URIref.

currently the only way seems to be to iterate through the namespaces() to find the binding and expand it manually before passing to URIRef

@joernhees
Copy link
Member

There is from_n3 ...

The thing with CURIEs is that you always need a manager which knows the namespace mapping... it's tempting (and i've done it a couple of times to just use one pre-filled from http://prefix.cc), but you get into a lot of trouble if you start serializing without the prefix definitions and then want to parse later on. Namespaces change over time (dbpedia vs dbp vs dbr vs dbpr)! It might be that you have a legit use-case for this, but it's as likely that you're getting yourself into trouble in the long run by not using a proper serializer and parser.

I'll close this for now, feel free to re-open.

@joernhees joernhees added enhancement New feature or request serialization Related to serialization. discussion labels May 11, 2016
@gromgull
Copy link
Member

He already has a namespace managed no? He wants the method that does the opposite of namespacemanager.qname?

@rob-metalinkage
Copy link
Author

OK - from_n3 looks that looks good - its just a little weird to be buried in utils - and curies are not scoped to n3 format - so this is too easy to miss. I would suggest at least putting a ref into the documentation for normalizeURI that the inverse exists, but is in a different place. Or put a convenience method into the NamespaceManager, which is where perhaps it really ought to live.

@joernhees joernhees reopened this May 12, 2016
@joernhees joernhees added this to the rdflib 4.2.2 milestone May 12, 2016
@joernhees joernhees added help wanted Extra attention is needed and removed discussion labels May 12, 2016
@gromgull gromgull modified the milestones: rdflib 5.0.0, rdflib 4.2.2 Jan 19, 2017
@gromgull
Copy link
Member

nice to have, but not a blocker for a bug-fixing-4.2 release. Moved to 5.0

@jclerman
Copy link
Contributor

Looks like this is a duplicate of #1868, which was closed last year - so this should be closed too?

@aucampia
Copy link
Member

@jclerman yes it should be closed, especially after this was merged:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed serialization Related to serialization.
Projects
None yet
Development

No branches or pull requests

6 participants