Skip to content

Instantly share code, notes, and snippets.

@ocorcho
Created June 21, 2016 13:17
Show Gist options
  • Save ocorcho/c0921f662217f572db3085b67a8bfc78 to your computer and use it in GitHub Desktop.
Save ocorcho/c0921f662217f572db3085b67a8bfc78 to your computer and use it in GitHub Desktop.
Consultas sobre PPROC para el TFG de Luis Galdo
SELECT DISTINCT ?uri str(min(?titulo)) as ?Titulo str(min(?nombre)) as ?Nombre ?fechaFormalizacion ucase(replace(replace(replace(?cif," ",""),"-",""),"/.","")) as ?Cif min(?servicioGestor) as ?ServicioGestor ?id ?precio
WHERE {
?uri a pproc:Contract.
?uri dcterms:title ?titulo.
?uri pc:tender ?tender.
?tender a pproc:FormalizedTender.
?tender pproc:formalizedDate ?fechaFormalizacion.
FILTER ( regex(?fechaFormalizacion, "2016"))
OPTIONAL {?tender pc:supplier ?empresaid.
?empresaid <http://www.w3.org/ns/org#identifier> ?cif.
OPTIONAL {?empresaid <http://schema.org/name> ?nombre.}}
OPTIONAL {?uri pproc:managingDepartment ?managingDepartment.
?managingDepartment dcterms:title ?servicioGestor
OPTIONAL {?managingDepartment dcterms:identifier ?id.}}
OPTIONAL {?tender pc:offeredPrice ?offeredPriceVAT.
?offeredPriceVAT gr:hasCurrencyValue ?precio.
?offeredPriceVAT gr:valueAddedTaxIncluded "true"^^xsd:boolean.}
}
GROUP BY ?uri ?cif ?id ?precio ?fechaFormalizacion
ORDER BY ?uri
SELECT DISTINCT ?uri min(?titulo) as ?Titulo min(?servicioGestor) as ?ServicioGestor ?fechaFormalizacion ?id ?precio ?empresa
WHERE {
?uri a pproc:Contract.
?uri dcterms:title ?titulo.
?uri pc:tender ?tender.
?tender a pproc:FormalizedTender.
?tender pproc:formalizedDate ?fechaFormalizacion.
OPTIONAL {?tender pc:supplier ?empresaid.
?empresaid <http://www.w3.org/ns/org#identifier> ?cif.
FILTER(regex(replace(replace(replace(?cif," ",""),"-",""),"/.",""),"A28017895","i"))
OPTIONAL {?empresaid <http://schema.org/name> ?empresa.}}
OPTIONAL {?uri pproc:managingDepartment ?managingDepartment.
?managingDepartment dcterms:title ?servicioGestor.
OPTIONAL {?managingDepartment dcterms:identifier ?id.}}
OPTIONAL {?tender pc:offeredPrice ?offeredPriceVAT.
?offeredPriceVAT gr:hasCurrencyValue ?precio.
?offeredPriceVAT gr:valueAddedTaxIncluded "true"^^xsd:boolean.}
}
GROUP BY ?uri ?id ?precio ?empresa ?fechaFormalizacion
SELECT DISTINCT ?uri min(?titulo) as ?Titulo ?nombre ?fechaFormalizacion ucase(replace(replace(replace(?cif," ",""),"-",""),"/.","")) as ?Cif min(?servicioGestor) as ?ServicioGestor ?id ?precio
WHERE {
?uri a pproc:Contract.
?uri dcterms:title ?titulo.
?uri pc:tender ?tender.
?tender a pproc:FormalizedTender.
?tender pproc:formalizedDate ?fechaFormalizacion.
OPTIONAL {?tender pc:supplier ?empresaid.
?empresaid <http://www.w3.org/ns/org#identifier> ?cif.
OPTIONAL {?empresaid <http://schema.org/name> ?nombre.}}
OPTIONAL {?uri pproc:managingDepartment ?managingDepartment.
?managingDepartment dcterms:title ?servicioGestor.
OPTIONAL {?managingDepartment dcterms:identifier ?id.}}
OPTIONAL {?tender pc:offeredPrice ?offeredPriceVAT.
?offeredPriceVAT gr:hasCurrencyValue ?precio.
?offeredPriceVAT gr:valueAddedTaxIncluded "true"^^xsd:boolean.}
FILTER(xsd:integer(?precio) > xsd:integer("50000000"))
}
GROUP BY ?uri ?nombre ?cif ?id ?precio ?fechaFormalizacion
ORDER BY desc(?precio)
SELECT DISTINCT ?uri min(?titulo) as ?Titulo ?fechaFormalizacion ?nombre ucase(replace(replace(replace(?cif," ",""),"-",""),"/.","")) as ?Cif ?precio
WHERE {
?uri a pproc:Contract.
?uri dcterms:title ?titulo.
?uri pc:tender ?tender.
?tender a pproc:FormalizedTender.
?tender pproc:formalizedDate ?fechaFormalizacion.
OPTIONAL {?tender pc:supplier ?empresaid.
?empresaid <http://www.w3.org/ns/org#identifier> ?cif.
OPTIONAL {?empresaid <http://schema.org/name> ?nombre.}}
OPTIONAL {?uri pproc:managingDepartment ?managingDepartment.
?managingDepartment dcterms:title ?servicioGestor.
OPTIONAL {?managingDepartment dcterms:identifier ?id.}}
OPTIONAL {?tender pc:offeredPrice ?offeredPriceVAT.
?offeredPriceVAT gr:hasCurrencyValue ?precio.
?offeredPriceVAT gr:valueAddedTaxIncluded "true"^^xsd:boolean.}
FILTER(regex(?id,"20800"))
} GROUP BY ?uri ?nombre ?cif ?id ?precio ?fechaFormalizacion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment