Dreams:report-index: Difference between revisions

From DREAMS
Jump to navigation Jump to search
(Fix publication date)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Rapporter ==
{{SPARQL | query=  
{{SPARQL | query=  
PREFIX target: <https://dreams.wikibase.cloud/entity/Q158>
PREFIX target: <https://dreams.wikibase.cloud/entity/Q158>
Line 7: Line 8:


SELECT  
SELECT  
   ?publication_date
   ?udgivelsesdato
   ?title ?titleUrl
   ?titel ?titelUrl
   ?miljøportal ?miljøportalUrl
   ?miljøportal ?miljøportalUrl
WHERE {
WHERE {
   ?report dreamst:P2 / dreamst:P10* dreams:Q8 .
   ?report dreamst:P2 / dreamst:P10* dreams:Q8 .
   OPTIONAL {
   OPTIONAL {
     ?report dreamst:P1 ?title .
     ?report dreamst:P1 ?titel .
     BIND(CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?titleUrl)
     BIND(CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?titelUrl)
   }
   }
   OPTIONAL {
   OPTIONAL {
     ?report dreamsp:P6 / dreamspsv:P6 ?publication_date_value .
     ?report dreamsp:P6 / dreamspsv:P6 ?udgivelsesdato_value .
     ?publication_date_value wikibase:timePrecision ?time_precision ;
     ?udgivelsesdato_value wikibase:timePrecision ?time_precision ;
                             wikibase:timeValue ?publication_date .
                             wikibase:timeValue ?udgivelsesdato_ .
     BIND(IF(?time_precision = 9, YEAR(?publication_date_), xsd:date(?publication_date_)) AS ?publication_date)
     BIND(IF(?time_precision = 9, YEAR(?udgivelsesdato_), xsd:date(?udgivelsesdato_)) AS ?udgivelsesdato)
   }
   }
   OPTIONAL {
   OPTIONAL {
Line 27: Line 28:
   }
   }
}
}
ORDER BY DESC(?publication_date)
ORDER BY DESC(?udgivelsesdato)
}}
}}

Latest revision as of 14:10, 9 December 2022

Rapporter

PREFIX target: <https://dreams.wikibase.cloud/entity/Q158>
PREFIX dreams: <https://dreams.wikibase.cloud/entity/>
PREFIX dreamst: <https://dreams.wikibase.cloud/prop/direct/>
PREFIX dreamsp: <https://dreams.wikibase.cloud/prop/>
PREFIX dreamspsv: <https://dreams.wikibase.cloud/prop/statement/value/> 

SELECT 
  ?udgivelsesdato 
  ?titel ?titelUrl
  ?miljøportal ?miljøportalUrl
WHERE {
  ?report dreamst:P2 / dreamst:P10* dreams:Q8 .
  OPTIONAL {
    ?report dreamst:P1 ?titel .
    BIND(CONCAT("#report/", SUBSTR(STR(?report), 38)) AS ?titelUrl)
  }
  OPTIONAL {
    ?report dreamsp:P6 / dreamspsv:P6 ?udgivelsesdato_value .
    ?udgivelsesdato_value wikibase:timePrecision ?time_precision ;
                            wikibase:timeValue ?udgivelsesdato_ .
    BIND(IF(?time_precision = 9, YEAR(?udgivelsesdato_), xsd:date(?udgivelsesdato_)) AS ?udgivelsesdato)
  }
  OPTIONAL {
    ?report dreamst:P40 ?miljøportal .
    BIND(IRI(CONCAT("https://daieproddreamspdfsto.blob.core.windows.net/files/", ?miljøportal)) AS ?miljøportalUrl)
  }
}
ORDER BY DESC(?udgivelsesdato)