Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:12

    jeenbroekstra on develop

    Bump log4j-core from 2.11.1 to … Merge pull request #2866 from e… Merge pull request #2883 from e… (compare)

  • 00:12
    jeenbroekstra closed #2883
  • Mar 01 22:35
    jeenbroekstra labeled #2756
  • Mar 01 22:35
    jeenbroekstra labeled #2756
  • Mar 01 22:33
    jeenbroekstra commented #2883
  • Mar 01 22:32
    github-actions[bot] opened #2883
  • Mar 01 22:31

    jeenbroekstra on main

    Bump log4j-core from 2.11.1 to … Merge pull request #2866 from e… (compare)

  • Mar 01 22:31

    jeenbroekstra on maven

    (compare)

  • Mar 01 22:31
    jeenbroekstra closed #2866
  • Mar 01 22:31
    jeenbroekstra commented #2866
  • Mar 01 21:43
    barthanssens commented #395
  • Mar 01 16:12

    hmottestad on develop

    GH-2861 reproduce issue Signed… Add Github corner to top right Merge pull request #2871 from e… and 15 more (compare)

  • Mar 01 16:12
    hmottestad closed #2877
  • Mar 01 08:35
    hmottestad synchronize #2757
  • Mar 01 08:04
    hmottestad synchronize #2877
  • Mar 01 08:04

    hmottestad on main

    GH-2861 reproduce issue Signed… GH-2861 fix Unique with compres… GH-2861 fix duplicate validatio… and 3 more (compare)

  • Mar 01 08:04

    hmottestad on GH-2861-validation-report-repetition

    (compare)

  • Mar 01 08:04
    hmottestad closed #2862
  • Mar 01 08:04
    hmottestad closed #2861
  • Mar 01 06:23
    jeenbroekstra synchronize #2877
AF2021
@AF2021
A lot of new terms
AF2021
@AF2021

Is it possible to set RDFXMLPrettyWriter so that it is not nesting statements or is there another thing that has to be changed.

I'm getting this:

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

<dcat:Catalog rdf:about="http://www.foo">
<rdf:type>
<dcat:Dataset rdf:about="https://example.com/dataset1">
</dcat:Dataset>
</rdf:type>
</dcat:Catalog>

</rdf:RDF>

But I would rather have a flat structure instead like this:

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

<dcat:Catalog rdf:about="http://www.foo">
<dcat:dataset rdf:resource="https://example.com/dataset1"/>
</dcat:Catalog>

<dcat:Dataset rdf:about="https://example.com/dataset1">
</dcat:Dataset>

</rdf:RDF>

Jeen Broekstra
@jeenbroekstra
@AF2021 there's no direct configuration control over that kind of thing, but the way the RDFXMLPrettyWriter works is that it relies on the order of the RDF statements that put into it. When the subject of a statement is the object of the previous statement (so called 'striped syntax'), it attempts to nest them.
so what you can do to make sure it's not nested is ensure that the statements about dataset1 do not immediately follow the statement where you say that your catalog has a dataset which is dataset1.
fwiw, don't take this as a criticism, but I personally never bother with this kind of thing. RDF/XML syntax is notoriously difficult to work with and to read. If I want something that is easy to read and well-organized I use the Turtle syntax.
Bart Hanssens
@barthanssens
indeed, though there is value in RDF/XML when the rest of the toolchain is XML-based (that's the beauty of RDF, one can express it in different serializations)
Jeen Broekstra
@jeenbroekstra
oh sure, if you have to use RDF/XML for one reason or another, then of course :) I just thought I'd mention that if you have a choice, there are easier syntax formats to work with.
Bart Hanssens
@barthanssens
good point :-) personally I use turtle for taxonomies and N-Triples for all the rest (to do basic queries with unix text tools ;-)... while the webdevs prefer a "framed" JSON-LD ... never used TriG nor TriX but I'm sure there are use cases as well
AF2021
@AF2021

No, that's fine and thanks for the input...I'll test
Maybe turtle is easier.

The file is valid RDF format after all.

Jeen Broekstra
@jeenbroekstra
@AF2021 btw when I say the "order of the RDF statements", it's kind of important to know how you can control that. I think you are using a LinkedHashModel object to create your RDF model, right? If so, you're in luck: a LinkedHashModel keeps the statements in the order in which you put them in. So all you'd need to do to change the order is to switch some of the model.add(....); java operations around.
Jeen Broekstra
@jeenbroekstra

No, that's fine and thanks for the input...I'll test
Maybe turtle is easier.

The file is valid RDF format after all.

:thumbsup: and of course feel free to continue asking questions here

AF2021
@AF2021
@barthanssens Thanks, I appreciate it. And the trick worked :)
@jeenbroekstra Thanks...I appreciate your help :)
Fernando Luján Martínez
@ferchitas
Hello everybody, I'm trying to understand what is the differences among RDF4J and Apache Jena. For me both of them are quite similar, taking into account what is described in the documentation web pages, but it would be great if someone could show me if I'm wrong or not.
Bart Hanssens
@barthanssens
well, they are indeed both java open source libraries / tools voor RDF4j, and both include triple stores, IMHO the main difference is that Jena has better support for reasoning, while RDF4J has excellent support for SHACL validation
as for API, that's probably a matter of taste, personally I prefer RDF4J's API :-)
RDF4J is also supported by various storage tools (like AWS Neptune DB, OntoText GraphDB, Stardog, and quite recently Oracle), though Jena can also be used for e.g. Stardog (and probably a few others, don't know them by heart)
Fernando Luján Martínez
@ferchitas
great, thank you. I'll perform some test with both of them and check which one fits better in our needs. Our main concern is the concurrency accessing to a in-memory dataset (read and write)
Jeen Broekstra
@jeenbroekstra
@ferchitas fwiw RDF4J has full transactional support, which allows for concurrent read/write. See https://rdf4j.org/documentation/programming/repository/#transactions
Bart Hanssens
@barthanssens
@ferchitas you probably want to use the NativeStore if you have > 100 K triples https://rdf4j.org/javadoc/latest/org/eclipse/rdf4j/sail/nativerdf/NativeStore.html
Fernando Luján Martínez
@ferchitas
we are using the repository to convert from a communication interface to other. Inserting the input object and retrieving with a construct sparql a converted object. And we are using Repositories.consume to do this because the documentation is indicated that it is transactional.
@barthanssens we are inserting less than 3k/4k triples in each conversion. When the object has been retrieved the repository is cleared
Bart Hanssens
@barthanssens
ok, good to know, though you still might want to consider to also evaluate the NativeStore, since the MemoryStore does not support concurrent transactions (but perhaps in your case the communication is fast enough to make it a non-issue) https://rdf4j.org/javadoc/latest/index.html?org/eclipse/rdf4j/sail/memory/MemoryStore.html
Fernando Luján Martínez
@ferchitas
The performance is good when there is a few requests, however, when they are increased the component is really slow. I think we could test with the NativeStore.
Jasper Koehorst
@jjkoehorst_gitlab
I was wondering if it is possible to validate an rdf file with rdf4j and encode invalid IRI's on the fly? I have some invalid triples containing ## and trying to figure out if this is possible with rdf4j or that you need an additional encoder?
Bart Hanssens
@barthanssens
validating can be turned on/off via parser settings, but not sure about encoding-on-the-fly part https://rdf4j.org/javadoc/latest/org/eclipse/rdf4j/rio/helpers/BasicParserSettings.html#VERIFY_URI_SYNTAX
AF2021
@AF2021

Hello again,

A new question. I read back an already created .RDF file into a model which looks like this:
<dcat:Catalog rdf:about="http://www.foo"> <dcterms:title xml:lang="sv">Katalogtitel</dcterms:title> <dcterms:description xml:lang="sv">Katalogeskrivning</dcterms:description> <dcterms:publisher rdf:resource="https://example.com/publisher1"/> <dcat:Dataset rdf:resource="https://example.com/dataset1"/> <dcterms:license rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/"/> </dcat:Catalog>

Then I add a statement with the code:

`model.add(cat, DCTERMS.TITLE, valueFactory.createLiteral("apappapapa", "sv"));

and print out the model again and the statement is added like this:

`<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:vcard="http://www.w3.org/2006/vcard/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

<dcat:Catalog rdf:about="http://www.foo">
<dcterms:title xml:lang="sv">Katalogtitel</dcterms:title>
<dcterms:description xml:lang="sv">Katalogeskrivning</dcterms:description>
<dcterms:publisher rdf:resource="https://example.com/publisher1"/>
<dcat:Dataset rdf:resource="https://example.com/dataset1"/>
<dcterms:license rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/"/>
</dcat:Catalog>

<foaf:Agent rdf:about="https://example.com/publisher1">
<foaf:name xml:lang="sv">Exampel organization</foaf:name>
</foaf:Agent>

<dcat:Dataset rdf:about="https://example.com/dataset1">
<dcterms:title xml:lang="sv">Datasettitel</dcterms:title>
<dcterms:description xml:lang="sv">Dataserbeskrivning</dcterms:description>
<dcat:Distribution rdf:resource="https://example.com/distribution1"/>
<dcterms:publisher rdf:resource="https://example.com/publisher1"/>
<dcat:contactPoint rdf:resource="https://example.com/contactpoint1"/>
</dcat:Dataset>

<dcat:Distribution rdf:about="https://example.com/distribution1">
<dcat:accessURL rdf:resource="http://example.com/api"/>
<dcat:accessService rdf:resource="https://example.com/dataservice1"/>
</dcat:Distribution>

<vcard:Organization rdf:about="https://example.com/contactpoint1">
<vcard:fn xml:lang="sv">Öppna data gruppen på exempel organisationen</vcard:fn>
<vcard:hasEmail rdf:resource="mailto:oppnadata@example.com"/>
</vcard:Organization>

<dcat:DataService rdf:about="https://example.com/distribution1">
<dcterms:title xml:lang="sv">Exempel API</dcterms:title>
<dcat:endpointURL rdf:resource="http://example.com/api"/>
</dcat:DataService>

<rdf:Description rdf:about="http://www.foo">
<dcterms:title xml:lang="sv">apappapapa</dcterms:title>
</rdf:Description>

</rdf:RDF>`

But I would like to have it like this instead.

<dcat:Catalog rdf:about="http://www.foo"> <dcterms:title xml:lang="sv">Katalogtitel</dcterms:title> <dcterms:description xml:lang="sv">Katalogeskrivning</dcterms:description> <dcterms:title xml:lang="sv">apappapapa</dcterms:title> <dcterms:publisher rdf:resource="https://example.com/publisher1"/> <dcat:Dataset rdf:resource="https://example.com/dataset1"/> <dcterms:license rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/"/> </dcat:Catalog>

Is there any way to control this?

Bart Hanssens
@barthanssens
ah, you mean that the added statement is added at the end instead of somewhere at the top ?
AF2021
@AF2021
Yes...sorry about the formatting.
Bart Hanssens
@barthanssens
as Jeen mentioned, you'll probably have to juggle with the order of the statements (or you could write your own XML serializer or apply some XSLT after generating the XML) ...
the prettyprinter can do some reasonable formatting, but may not always be as flexible as one wants in (non-RDF) XML flows
it might work if you first create a Model and (from that model) do some querying/inserting in a new model in the "correct" order
AF2021
@AF2021
Ok, some different options. Since I read my own .RDF file and loop through the statements I need somehow to figure out the correct order. It was easier to put the correct order when the file was first created
Bart Hanssens
@barthanssens
mm yes, well, it's hard to get it "right" and resource-friendly enough for all cases (think circular references, and large files), because RDF/XML basically tries to map a very loose graph structure to a rather strict hierarchical view
Jeen Broekstra
@jeenbroekstra
@AF2021 the BufferedGroupingRDFHandler might be of interest to you. This is a wrapper for Rio writers that takes an input model and makes sure the contents are delivered to the underlying writer in a sensible grouped order. It groups by context, then subject, then predicate. See https://rdf4j.org/javadoc/latest/index.html?org/eclipse/rdf4j/rio/helpers/BufferedGroupingRDFHandler.html
of course a downside of that is that it may break striping (and therefore nesting).
AF2021
@AF2021
@jeenbroekstra The BufferedGroupingRDFHandler did the trick. :) Since I don't want nesting but rather the order I added the statements
AF2021
@AF2021

Assuming I have this this resource which is loaded into the LinkedHashModel:
<dcat:Catalog rdf:about="http://www.foo">
<dcterms:title xml:lang="sv">Katalogtitel</dcterms:title>
<dcterms:description xml:lang="sv">Katalogeskrivning</dcterms:description>
<dcterms:publisher rdf:resource="https://example.com/publisher1"/>
<dcat:Dataset rdf:resource="https://example.com/dataset1"/>
<dcterms:license rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/"/>
</dcat:Catalog>

Is there a simple way to access get the whole "dcat:Catalog" from the model as an aggregate. Is it best to do this with the filter method?

Thanks for all the great help you are providing :)

Bart Hanssens
@barthanssens
hmz, the filter method can be used to get all the statements with a specific subject/predicate and/or object, so you'll get the dcterms:title etc, but not the http://www.foo a <dcat:Catalog> itself
And a minor DCAT note, you probably want to use dcat:dataset (lowercase D) instead of dcat:Dataset (uppercase D) since the property "has dataset" is dcat:dataset...
hmottestad
@hmottestad
Going to release today.
Plan
  • wait for eclipse/rdf4j#2847
  • merge develop into master
  • start release
  • merge release notes
  • update maven version numbers
Jeen Broekstra
@jeenbroekstra
Sounds good, go for it!
hmottestad
@hmottestad
release is going well
jenkins is done
now I'm waiting for some PRs to complete CI before I move to updating the maven version numbers and merging the release notes
hmottestad
@hmottestad
@jeenbroekstra Did we agree to move to 4.0.0 now, or stay with 3.x and move to 3.7.0?
hmottestad
@hmottestad
Going to sign off here now. We can decide on 4.0 vs. 3.7 here: eclipse/rdf4j#2853
Jeen Broekstra
@jeenbroekstra
Heads up: we're in the middle of renaming our default branch to main. Some things may not work for a bit and you may need to update your clone. Replacement buses will arrive at platform 6.