Consultas_ok

consultas

Algunos ejemplos de consultas al punto SPARQL del IEPNB.

 

El siguiente ejemplo busca todas las especies cuyo nombre scientífico contenga ‘canis’

PREFIX plinian:<https://datos.iepnb.es/def/sector-publico/medio-ambiente/pliniancore#>
PREFIX darwin: <http://rs.tdwg.org/dwc/terms/>
select
DISTINCT ?TaxonRecordID ?ScientificName where
{?TaxonRecord plinian:hasHierarchy ?Taxon .
?TaxonRecord plinian:TaxonRecordID ?TaxonRecordID .
OPTIONAL{?Taxon darwin:scientificName ?ScientificName} .
filter contains(lcase(?ScientificName),'canis')}

Ejecutar Consulta


 

Obtiene toda la información acerca del Taxon ‘11627 (Canis lupus Linnaeus, 1758)’

PREFIX pl:<https://datos.iepnb.es/def/sector-publico/medio-ambiente/pliniancore#>
PREFIX dw: <http://rs.tdwg.org/dwc/terms/>
select distinct * where {{ ?TR pl:TaxonRecordID '11627'. OPTIONAL{?TR pl:FullDescriptionUnstructured ?FuDeUn}. ?TR pl:hasHierarchy ?b . OPTIONAL{?b dw:scientificName ?ScNa}. OPTIONAL{?b dw:higherClassification ?HiCl}. OPTIONAL{?b dw:taxonRank ?Rank}. OPTIONAL{?b dw:verbatimTaxonRank ?VeTa}. OPTIONAL{?b dw:scientificNameAuthorship ?ScNA}. OPTIONAL{?b dw:taxonRemarks ?TaRe}. OPTIONAL{?b dw:class ?Class}. OPTIONAL{?b dw:phylum ?Phylum}. OPTIONAL{?b dw:order ?Order}. OPTIONAL{?b dw:family ?Family}. OPTIONAL{?b dw:genus ?Genus}. OPTIONAL{?b dw:subgenus ?SubGenus}. OPTIONAL{?b dw:specificEpithet ?SpEp}. OPTIONAL{?b dw:infraspecificEpithet ?InSpEp}. OPTIONAL{?b dw:group ?Group}. OPTIONAL{?b dw:kingdom ?Kingdom}. OPTIONAL{?b dw:taxonomicStatus ?TaxonomicStatus}. } UNION { select * { ?TR pl:TaxonRecordID '11627'. ?TR pl:hasMeasurement ?Ms. OPTIONAL{?Ms dw:measurementType ?MeTy }. OPTIONAL{?Ms pl:AppliesTo ?AppliesTo }. OPTIONAL{?Ms pl:Literal ?Literal }. OPTIONAL{?Ms dw:measurementValue ?MeaV }. OPTIONAL{?Ms dw:measurementAccuracy ?MeAcc}. OPTIONAL{?Ms dw:measurementDeterminedDate ?MeaDD }. OPTIONAL{?Ms dw:measurementRemarks ?MeaRe }. OPTIONAL{?Ms pl:measurementUnit ?MeaUn }. } order by ?MeTy ?AppliesTo ?MeAcc ?Literal } UNION { ?TR pl:TaxonRecordID '11627'. ?TR pl:hasVernacularName ?VN. ?VN pl:Name ?VerName. ?VN pl:Language ?VerLang. } UNION { ?TR pl:TaxonRecordID '11627'. ?TR pl:hasDistribution ?Ds. OPTIONAL{?Ds pl:Distribution_Type ?DisT}. OPTIONAL{?Ds pl:DistributionScope ?DisCp}. OPTIONAL{?Ds pl:DistributionScopeType ?DsCT}. OPTIONAL{?Ds pl:DistributionUnstructured ?DisUn}. OPTIONAL{?Ds pl:GeographicEntity ?Ge}. OPTIONAL{?Ds pl:temporalCoverage ?Tc}. } UNION { ?TR pl:TaxonRecordID '11627'. ?TR pl:hasCollection ?Co. OPTIONAL{?Co pl:CollectionDescription ?ColDs}. OPTIONAL{?Co pl:Country_txt ?Country_txt}. OPTIONAL{?Co pl:Year ?Year}. } UNION { ?TR pl:TaxonRecordID '11627'. ?TR pl:hasInvasiveness ?In. OPTIONAL{?In pl:InvasivenessUnstructured ?InvUn}. OPTIONAL{?In pl:Route ?Route}. OPTIONAL{?In pl:origin ?origin}. OPTIONAL{?In pl:vector ?vector}. } UNION { SELECT distinct ?ii, ?LegN, group_concat(distinct ?LegR;separator=', ') as ?LegR, ?PrLS, group_concat(distinct ?Remarks;separator=', ') as ?LegRemarkswhere{ ?TR pl:TaxonRecordID '11627'. ?TR pl:hasLegislation ?ii. OPTIONAL{?ii pl:LegislationName ?LegN}. OPTIONAL{?ii pl:LegislationRead ?LegR}. OPTIONAL{?ii pl:ProtectionLegalStatus ?PrLS}. OPTIONAL{?ii pl:Remarks ?Remarks}.} } UNION { ?TR pl:TaxonRecordID '11627' . ?TR pl:hasDirectThreats ?DiTh . ?DiTh pl:DirectThreatUnstructured ?ThUn. } UNION { ?TR pl:TaxonRecordID '11627'. ?TR pl:hasHabitats ?Ha.?Ha pl:HabitatUnstructured ?HaUn.} UNION { ?TR pl:TaxonRecordID '11627'. ?TR pl:hasThreatStatus ?TS . OPTIONAL{?TS pl:Year ?Year}. OPTIONAL{?TS pl:Authority ?Authority}. OPTIONAL{?TS pl:ThreatCategory ?Cat}. OPTIONAL{?TS pl:ThreatStatusUnstructured ?TSUn}. OPTIONAL{?TS pl:coverageArea ?covArea}.} UNION { ?TR pl:TaxonRecordID '11627' . ?TR pl:hasManagementConservation ?MC . OPTIONAL{?MC dw:ConservationMeasurementUnstructured ?ConMeUn}. OPTIONAL{?MC dw:HumanAndEnvironmentalRelevanceUnstructured ?HUR}. ?MC pl:Objectives ?Obj. ?MC pl:ManagementType ?ManType. OPTIONAL{?MC dw:HumanAndEnvironmentalRelevance ?HuER}. ?MC dw:ManagementRemarks ?q. ?MC dw:ManagementPlan ?y. bind(concat(?q, '. ', ?y) as ?ManRem). OPTIONAL{?MC dw:ManagementRemarks ?Pln}. OPTIONAL{?MC dw:Year ?Dt}. } UNION { ?TR pl:TaxonRecordID '11627' . ?TR pl:hasPopulationBiology ?PoBi . ?PoBi pl:PopulationBiologyUnstructured ?PoBiUn} UNION { ?TR pl:TaxonRecordID '11627' . ?TR pl:hasRecordMetadata ?RMt . ?RMt pl:hasRevision ?Rev . ?Rev dc:title ?ti. ?Rev dc:source ?so. }}

Ejejcutar consulta

 


Todas las especies localizadas en el punto geográfico ( -3.6931314467074112, 40.44180608351954)

PREFIX plinian:<https://datos.iepnb.es/def/sector-publico/medio-ambiente/pliniancore#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dwc: <http://rs.tdwg.org/dwc/terms/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX darwin: <http://rs.tdwg.org/dwc/terms/>
PREFIX CuadriculaEsp: <https://datos.iepnb.es/def/sector-publico/cuadricula-espacial#>
select DISTINCT
?ScientificName ?SpecificEpithet ?HigherClassification ?CodEunis
where {
?TaxonRecord plinian:hasLocation ?Location.
?TaxonRecord plinian:hasHierarchy ?Taxon .
?Taxon darwin:scientificName ?ScientificName .
OPTIONAL{?TaxonRecord plinian:CodeEUNIS ?CodEunis}.
OPTIONAL{?Taxon darwin:higherClassification ?HigherClassification} .
OPTIONAL{?Taxon darwin:specificEpithet ?SpecificEpithet } .
?Location plinian:hasCell ?celda .
?celda geo:hasGeometry ?geo.
?geo geo:asWKT ?WKT .
FILTER (bif:st_intersects(bif:st_geomfromtext(STR(?WKT)),bif:st_point(-2.7700742695887297, 40.29235443868308),0))
}
order by ?TaxonRecord

Ejecutar consulta

 

Obtiene la legislación acerca de la especie ‘Canis lupus’ mediante una consulta federada al punto SPARQL ‘eidos’ y el de ‘eunis’

PREFIX plinian:<https://datos.iepnb.es/def/sector-publico/medio-ambiente/pliniancore#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX malla: <https://datos.iepnb.es/def/sector-publico/cuadricula-espacial#>
PREFIX res: <http://datos.iepnb.es/resource/Concept/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX darwin: <http://rs.tdwg.org/dwc/terms/>
PREFIX btn100: <https://datos.ign.es/def/btn100#>
PREFIX esadm: <http://vocab.linkeddata.es/datosabiertos/def/sector-publico/territorio#>
select DISTINCT * where {{{
select DISTINCT ?EidosTaxonRecordId ?EidosScientificName ?EidosCodEunis
where {
?Location plinian:hasCell ?cuadricula .
?Location plinian:isLocationOf ?TaxonRecord .
?TaxonRecord plinian:hasHierarchy ?b .
?TaxonRecord plinian:TaxonRecordID ?EidosTaxonRecordId.
?b darwin:scientificName ?EidosScientificName .
OPTIONAL{
?TaxonRecord plinian:CodeEUNIS ?EidosCodEunis}.
{select DISTINCT ?cuadricula ?CodCelda where {
?cuadricula geo:hasGeometry ?geo.
?geo geo:asWKT ?WKT .
?cuadricula malla:cod ?CodCelda .
FILTER (bif:st_intersects(bif:st_geomfromtext(STR(?WKT)),bif:st_point(-4.193481042981146, 41.38505189939636),0))}
limit 1}}order by ?EidosScientificName}}
UNION {{
SERVICE <https://datos.ign.es/sparql> {
select * where {{
select DISTINCT ?IgnName where {
?Ign geo:hasGeometry ?geom.
?Ign dc:title ?IgnName .
?geom geo:asWKT ?WKT2 .
FILTER (bif:st_intersects(?WKT2, bif:st_point(-4.193481042981146, 41.38505189939636)))}limit 1000}
UNION {
select DISTINCT ?IgnName ?IgnAltitudOrtometrica ?IgnCota
where {
?Ign geo:hasGeometry ?geom.
?geom rdf:type <http://www.opengis.net/ont/sf#Point>.
?Ign dc:title ?IgnName .
OPTIONAL{
?Ign btn100:altitudOrtometrica ?IgnAltitudOrtometrica} .
OPTIONAL{?Ign btn100:cota ?IgnCota} .
?geom geo:asWKT ?WKT2 .
FILTER (bif:GeometryType (?WKT2) = 'POINT') .
FILTER (bif:st_distance(?WKT2,bif:st_point(-4.193481042981146, 41.38505189939636))<5) .}
limit 1000}}}}}} limit 1000

Ejecutar consulta

Obtiene las especies de EIDOS y los elementos geográficos del catálogo de datos (BTN100) localizados en el punto geográfico (-4.193481042981146, 41.38505189939636) mediante una consulta federada entre punto SPARQL de IEPNB y de IGN.

PREFIX plinian:<https://datos.iepnb.es/def/sector-publico/medio-ambiente/pliniancore#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX malla: <https://datos.iepnb.es/def/sector-publico/cuadricula-espacial#>
PREFIX res: <http://datos.iepnb.es/resource/Concept/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX darwin: <http://rs.tdwg.org/dwc/terms/>
PREFIX btn100: <https://datos.ign.es/def/btn100#>
PREFIX esadm: <http://vocab.linkeddata.es/datosabiertos/def/sector-publico/territorio#>
select DISTINCT * where {{{
select DISTINCT ?EidosTaxonRecordId ?EidosScientificName ?EidosCodEunis
where {
?Location plinian:hasCell ?cuadricula .
?Location plinian:isLocationOf ?TaxonRecord .
?TaxonRecord plinian:hasHierarchy ?b .
?TaxonRecord plinian:TaxonRecordID ?EidosTaxonRecordId.
?b darwin:scientificName ?EidosScientificName .
OPTIONAL{
?TaxonRecord plinian:CodeEUNIS ?EidosCodEunis}.
{select DISTINCT ?cuadricula ?CodCelda where {
?cuadricula geo:hasGeometry ?geo.
?geo geo:asWKT ?WKT .
?cuadricula malla:cod ?CodCelda .
FILTER (bif:st_intersects(bif:st_geomfromtext(STR(?WKT)),bif:st_point(-4.193481042981146, 41.38505189939636),0))}
limit 1}}order by ?EidosScientificName}}
UNION {{
SERVICE <https://datos.ign.es/sparql> {
select * where {{
select DISTINCT ?IgnName where {
?Ign geo:hasGeometry ?geom.
?Ign dc:title ?IgnName .
?geom geo:asWKT ?WKT2 .
FILTER (bif:st_intersects(?WKT2, bif:st_point(-4.193481042981146, 41.38505189939636)))}limit 1000}
UNION {
select DISTINCT ?IgnName ?IgnAltitudOrtometrica ?IgnCota
where {
?Ign geo:hasGeometry ?geom.
?geom rdf:type <http://www.opengis.net/ont/sf#Point>.
?Ign dc:title ?IgnName .
OPTIONAL{
?Ign btn100:altitudOrtometrica ?IgnAltitudOrtometrica} .
OPTIONAL{?Ign btn100:cota ?IgnCota} .
?geom geo:asWKT ?WKT2 .
FILTER (bif:GeometryType (?WKT2) = 'POINT') .
FILTER (bif:st_distance(?WKT2,bif:st_point(-4.193481042981146, 41.38505189939636))<5) .}
limit 1000}}}}}} limit 1000

Ejecutar consulta

Scroll hacia arriba