I quess sieve is now part of ldif (http://ldif.wbsg.de/) and then there is also SILK (http://silkframework.org/) that has nice UI for creating transformation scripts.
----- Original Message ----- From: "mikael pesonen" <[email protected]> To: "Miika Alonen" <[email protected]>, [email protected] Sent: Friday, 7 October, 2016 14:21:56 Subject: Re: Formatting of values in SPARQL Hi, never would have though this, quite nice way. Those 3 technologies are new to me and spin especially seems interesting - also in general when generating SPARQL. So lot to learn... Thanks! Mikael On 7.10.2016 12:39, Miika Alonen wrote: > Hi, > > You could resolve "schemas" to separate graphs (here ?model) and change the > datatypes using sparql. > > DELETE { ?s ?p ?o } > INSERT { ?s ?p ?o2 } > WHERE > { > GRAPH ?data { > ?s ?p ?o . > FILTER(isLiteral(?o) && lang(?o) = "") > BIND(STRDT(STR(?o), ?range) AS ?o2) > } > GRAPH ?model { > ?p a ?type . > VALUES ?type { rdf:Property owl:DatatypeProperty } > ?p rdfs:range ?range . > } > } > > ... But it might be better to validate the data first using sieve, SPIN or > SHACL etc. > > Best Regards, > Miika Alonen > > CSC - IT Center for Science > [email protected] > > ----- Original Message ----- > From: "Mikael Pesonen" <[email protected]> > To: [email protected] > Sent: Friday, 7 October, 2016 11:58:21 > Subject: Formatting of values in SPARQL > > Hi, > > Im using php at the moment to store data to Jena. Data comes in in > various formats and my code generates update SPARQL from that. > Anyone know if there is some library or code that could format the > values based on schema? > > For example I would load Dublin Core schema and library would format > dcterms:references values to <reference>, dcterms:description to > "description"@lang, dcterms:modified to modified_date^^xsd:dateTime etc. > > Or would Jena java library handle that for me? > > Br, > Mikael > -- www.lingsoft.fi Speech Applications - Language Management - Translation - Reader's and Writer's Tools - Text Tools - E-books and M-books Mikael Pesonen System Engineer e-mail: [email protected] Tel. +358 2 279 3300 Time zone: GMT+2 Helsinki Office Eteläranta 10 FI-00130 Helsinki FINLAND Turku Office Linnankatu 10 A FI-20100 Turku FINLAND
