Hi all, We (Edmond and I as RDFLib maintainers) are about to implement some version of this for RDFLib. The use case there is to preserve BNode IDs to make version control-based delta processing easier. We use RDF Delta to get data to and from triplestores like Jena via Python scripting, so we need Jena and RDFLib to all be on the same page here.
Will report progress. Cheers, Nick On Monday, 1 July 2024 at 01:06, Paul Tyson <phty...@sbcglobal.net> wrote: > On 6/30/24 06:27, Andy Seaborne wrote: > > > Hi Paul, > > > > You want this to make bnodes in the Fuseki server addressable? > > Yes, exactly. Not formally skolemization, more of a data quality issue. > While working out some graph processing use cases, I discovered that > addressable nodes are helpful, if not necessary. It's easy enough to get > a list of nodes by type, but if you want to go back and get further > details of each node, it's problematic without URIs. The node properties > are variegated, so it's cumbersome to construct a sparql query with > enough OPTIONAL clauses to get all the info you want on the first query > for node types. > > > I agree it would be nice for something in riot to do this. > > As a convenience, yes. If misused, it could surprise users by modifying > stored data in ways they didn't expect. In my case, it would just be > protection against defective inputs. > > > What skolemization naming schemes are popular? > > I don't know. I was thinking of something like '.../.well-known/genid/...' > > > It's possible to convert using text processing on N-Triples. Regex for > > (^| )_: and replace with a urn:uuid:... or what every scheme you want. > > > > Maybe urn:bnode:... > > Yes, if it turns out to be a persistent problem with data input, I could > do something like that, or Martynas's Skolemizer. > > > Jena also has a non-standard extension: > > > > URI(bnode()) => <_:44f86b24-8556-44e0-89eb-27e3bf21c66e> > > > > "_:" is illegal as a URI scheme and also as a relative URI so thjat's > > illegal as a URI, strictly but Jena allows it. > > > > It can be in SPARQL results and queries. > > > > When a Jena parser or result set reader sees "_:" it uses the rest as > > the bnode id. > > > Ah, that's what I was missing. I did try using the bnode id in a query > as a curie but it was illegal. I will try as a uriref. That would be the > shortest of short-term fixes for my immediate problem. > > Thank you, > --Paul > > > Unlike skolemization, The data and results really do have a bnode in > > it so the data itself is unchanged. > > > > Andy > > > > Related but different: : https://github.com/apache/jena/issues/2549 > > "More granular control over Blank node serialization" > > > > On 6/27/24 22:57, Martynas Jusevičius wrote: > > > > > LinkedDataHub has a class that does that: > > > https://github.com/AtomGraph/LinkedDataHub/blob/develop/src/main/java/com/atomgraph/linkeddatahub/server/util/Skolemizer.java > > > > > > On Thu, Jun 27, 2024 at 11:55 PM Paul Tyson phty...@sbcglobal.net > > > wrote: > > > > > > > I searched the source and docs but didn't turn up any easy way to > > > > skolemize an input graph before loading to fuseki. The skolemization > > > > capabilities appear to be related to the reasoners, which I don't need. > > > > > > > > I expect there's a good reason for this missing feature, but wanted to > > > > ask if I've missed something. I probably don't need it badly enough to > > > > build something for it. It would be better if the dataset came to me > > > > with the necessary node ids, but am considering if it's worth > > > > putting in > > > > a fixup routine. > > > > > > > > Thanks > > > > --Paul