jeenbroekstra on develop
Bump log4j-core from 2.11.1 to … Merge pull request #2866 from e… Merge pull request #2883 from e… (compare)
jeenbroekstra on main
Bump log4j-core from 2.11.1 to … Merge pull request #2866 from e… (compare)
jeenbroekstra on maven
hmottestad on develop
GH-2861 reproduce issue Signed… Add Github corner to top right Merge pull request #2871 from e… and 15 more (compare)
hmottestad on main
GH-2861 reproduce issue Signed… GH-2861 fix Unique with compres… GH-2861 fix duplicate validatio… and 3 more (compare)
hmottestad on GH-2861-validation-report-repetition
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>
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.
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?
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
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 :)