• This project
    • Loading...
  • Sign in

data.posccaesar.org / rdl

Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Graphs
  • Issues 12
  • Merge Requests 0
  • Wiki
  • Network
  • Create a new issue
  • Commits
  • Issue Boards
Closed
Open
Issue #4 opened 2014-07-17 16:45:39 UTC by Håvard M. Ottestad@hmottestad

Convert string to date

There are many strings in the RDL that should be dates. These should be converted.

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
PREFIX p2: <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#>
PREFIX rds: <http://rdl.rdlfacade.org/data#>
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>

PREFIX rdl: <http://data.posccaesar.org/rdl/>
PREFIX ptrn: <http://data.posccaesar.org/ptrn/>

construct {
?a rdl:hasCreationDate ?date.
}
 where {

    ?a rdl:hasCreationDate ?x.

BIND(strdt(str(replace(?x, "\\.", "-")), xsd:date) as ?date)


}
Edited 2014-07-29 12:22:09 UTC
  • Håvard M. Ottestad
    @hmottestad commented 2014-07-29 11:58:58 UTC
    PREFIX owl: <http://www.w3.org/2002/07/owl#>
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
    PREFIX p2: <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#>
    PREFIX rds: <http://rdl.rdlfacade.org/data#>
    PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
    PREFIX dc: <http://purl.org/dc/elements/1.1/>
    
    PREFIX rdl: <http://data.posccaesar.org/rdl/>
    PREFIX ptrn: <http://data.posccaesar.org/ptrn/>
    
    delete{
        ?a rdl:hasCreationDate ?x.
    } insert {
        ?a rdl:hasCreationDate ?date.
    } where {
        ?a rdl:hasCreationDate ?x.
        BIND(strdt(str(replace(?x, "\\.", "-")), xsd:date) as ?date)
    }
    
    
    Edited 2014-07-29 12:00:23 UTC
  • Håvard M. Ottestad
    @hmottestad commented 2014-07-29 12:22:07 UTC

    Completed in stash.

  • Håvard M. Ottestad
    @hmottestad 2014-07-29 12:22:09 UTC

    Status changed to closed

  • readonly
    @readonly 2015-02-01 17:47:36 UTC

    mentioned in commit 181fae

  • readonly
    @readonly 2015-04-15 11:31:31 UTC

    mentioned in commit 181fae66

  • Please register or login to post a comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
None
Due date
No due date
0
Labels
None
Assign labels
  • View labels
2
2 participants
Reference: data-posccaesar-org/rdl#4