You need to sign up in CRAFTS in order to follow this guide. Please do it here.
{
"apiId": "test",
"endpoints": [
{
"id": "crossforest",
"sparqlURI": "https://forestexplorer.gsic.uva.es/sparql/",
"graphURI": "http://crossforest.eu",
"httpMethod": "GET"
}
],
"model": [
{
"id": "Tree",
"oprops": [ ],
"dprops": [
{
"label": "heightM",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasTotalHeightInMeters",
"endpoint": "crossforest"
}
],
"types": []
}
],
"queryTemplates": [ ]
}
PUT /apis/test
(include the configuration above in the body request)
PUT requests can be easily sent using the form in the documentation pageGET /apis/test/resource
id Tree
iri https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/06-0035-A-1-5
https://crafts.gsic.uva.es/apis/test/resource?id=Tree&iri=https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/06-0035-A-1-5Retrieve another sample tree
GET /apis/test/resource
id Tree
iri https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/06-0035-A-1-6
Retrieve two sample trees
GET /apis/test/resources
id Tree
iris https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/06-0035-A-1-5
iris https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/06-0035-A-1-6
Changes from previous step
{
"apiId": "test",
"endpoints": [
{
"id": "crossforest",
"sparqlURI": "https://forestexplorer.gsic.uva.es/sparql/",
"graphURI": "http://crossforest.eu",
"httpMethod": "GET"
}
],
"model": [
{
"id": "Tree",
"oprops": [
{
"label": "position",
"targetId": "Position",
"iri": "http://crossforest.eu/position/ontology/hasPosition",
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "dbh1mm",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasDBH1InMillimeters",
"endpoint": "crossforest"
},
{
"label": "dbh2mm",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasDBH2InMillimeters",
"endpoint": "crossforest"
},
{
"label": "heightM",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasTotalHeightInMeters",
"endpoint": "crossforest"
}
],
"types": []
},
{
"id": "Position",
"oprops": [
{
"label": "crs",
"iri": "http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem",
"endpoint": "crossforest"
},
{
"label": "reference",
"iri": "http://crossforest.eu/position/ontology/hasReference",
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "latWGS84",
"iri": "http://epsg.w3id.org/ontology/axis/1",
"endpoint": "crossforest"
},
{
"label": "lngWGS84",
"iri": "http://epsg.w3id.org/ontology/axis/2",
"endpoint": "crossforest"
},
{
"label": "latUTM",
"iri": "http://epsg.w3id.org/ontology/axis/47",
"endpoint": "crossforest"
},
{
"label": "lngUTM",
"iri": "http://epsg.w3id.org/ontology/axis/48",
"endpoint": "crossforest"
},
{
"label": "distRefM",
"iri": "http://crossforest.eu/position/ontology/hasDistanceInMeters",
"endpoint": "crossforest"
},
{
"label": "dirGons",
"iri": "http://crossforest.eu/position/ontology/hasDirectionInGradians",
"endpoint": "crossforest"
}
],
"types": []
}
],
"queryTemplates": [ ]
}
Publish this API
PUT /apis/test
(include the configuration above in the body request)
Retrieve a sample tree
GET /apis/test/resource
id Tree
iri https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/06-0035-A-1-5
GET /apis/test/resource
id Position
iri https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/position/06-0035-A-1-5
https://crafts.gsic.uva.es/apis/test/resource?id=Position&iri=https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/position/06-0035-A-1-5GET /apis/test/resource
id Position
iri https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/position/06-0035-A-1-5-23029
https://crafts.gsic.uva.es/apis/test/resource?id=Position&iri=https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/position/06-0035-A-1-5-23029GET /apis/test/resource
id Position
iri https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/position/06-0035-A-1-5-23029-4326
https://crafts.gsic.uva.es/apis/test/resource?id=Position&iri=https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/position/06-0035-A-1-5-23029-4326Changes from previous step
{
"apiId": "test",
"endpoints": [
{
"id": "crossforest",
"sparqlURI": "https://forestexplorer.gsic.uva.es/sparql/",
"graphURI": "http://crossforest.eu",
"httpMethod": "GET"
}
],
"model": [
{
"id": "Tree",
"oprops": [
{
"label": "position",
"targetId": "Position",
"iri": "http://crossforest.eu/position/ontology/hasPosition",
"embed": true,
"restrictions": [
"?value <http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem> <http://epsg.w3id.org/data/crs/4326> ."
],
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "dbh1mm",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasDBH1InMillimeters",
"endpoint": "crossforest"
},
{
"label": "dbh2mm",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasDBH2InMillimeters",
"endpoint": "crossforest"
},
{
"label": "heightM",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasTotalHeightInMeters",
"endpoint": "crossforest"
}
],
"types": []
},
{
"id": "Position",
"oprops": [
{
"label": "crs",
"iri": "http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem",
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "latWGS84",
"iri": "http://epsg.w3id.org/ontology/axis/1",
"endpoint": "crossforest"
},
{
"label": "lngWGS84",
"iri": "http://epsg.w3id.org/ontology/axis/2",
"endpoint": "crossforest"
}
],
"types": []
}
],
"queryTemplates": [ ]
}
Publish this API
PUT /apis/test
(include the configuration above in the body request)
Retrieve a sample tree
GET /apis/test/resource
id Tree
iri https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/06-0035-A-1-5
GET /apis/test/resource
id Position
iri https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/position/06-0035-A-1-5-23029-4326
https://crafts.gsic.uva.es/apis/test/resource?id=Position&iri=https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/position/06-0035-A-1-5-23029-4326Changes from previous step
{
"apiId": "test",
"endpoints": [
{
"id": "crossforest",
"sparqlURI": "https://forestexplorer.gsic.uva.es/sparql/",
"graphURI": "http://crossforest.eu",
"httpMethod": "GET"
}
],
"model": [
{
"id": "Tree",
"oprops": [
{
"label": "position",
"targetId": "Position",
"iri": "http://crossforest.eu/position/ontology/hasPosition",
"embed": true,
"restrictions": [
"?value <http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem> <http://epsg.w3id.org/data/crs/4326> ."
],
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "dbh1mm",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasDBH1InMillimeters",
"endpoint": "crossforest"
},
{
"label": "dbh2mm",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasDBH2InMillimeters",
"endpoint": "crossforest"
},
{
"label": "heightM",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasTotalHeightInMeters",
"endpoint": "crossforest"
}
],
"types": []
},
{
"id": "Position",
"oprops": [
{
"label": "crs",
"iri": "http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem",
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "latWGS84",
"iri": "http://epsg.w3id.org/ontology/axis/1",
"endpoint": "crossforest"
},
{
"label": "lngWGS84",
"iri": "http://epsg.w3id.org/ontology/axis/2",
"endpoint": "crossforest"
}
],
"types": []
}
],
"queryTemplates": [
{
"id": "treesinbox",
"description": "Obtain trees (variable \"tree\") and their coordinates (variables \"tlat\", \"tlng\") in a box (parameters \"lngwest\", \"lngeast\", \"latsouth\", \"latnorth\"). This template query can be paginated with the optional parameters \"limit\" and \"offset\"",
"template": "SELECT DISTINCT ?tree ?tlat ?tlng WHERE {\n?tree a <https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/Tree> ;\n <http://crossforest.eu/position/ontology/hasPosition> ?pos .\n?pos <http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem> <http://epsg.w3id.org/data/crs/4326> ;\n <http://epsg.w3id.org/ontology/axis/1> ?tlat ;\n <http://epsg.w3id.org/ontology/axis/2> ?tlng .\n{{#latsouth}} FILTER (?tlat > {{latsouth}}) .\n{{/latsouth}}{{#latnorth}} FILTER (?tlat < {{latnorth}}) .\n{{/latnorth}}{{#lngwest}} FILTER (?tlng > {{lngwest}}) .\n{{/lngwest}}{{#lngeast}} FILTER (?tlng < {{lngeast}}) .\n{{/lngeast}}} \n{{#limit}}LIMIT {{limit}}{{/limit}}{{^limit}}LIMIT 100{{/limit}}{{#offset}}\nOFFSET {{offset}}{{/offset}}",
"variables": [
"tree",
"tlat",
"tlng"
],
"parameters": [
{
"label": "lngwest",
"type": "number",
"optional": true
},
{
"label": "lngeast",
"type": "number",
"optional": true
},
{
"label": "latnorth",
"type": "number",
"optional": true
},
{
"label": "latsouth",
"type": "number",
"optional": true
},
{
"label": "limit",
"type": "integer",
"optional": true
},
{
"label": "offset",
"type": "integer",
"optional": true
}
],
"endpoint": "crossforest"
}
]
}
Publish this API
PUT /apis/test
(include the configuration above in the body request)
Submit treesinbox query with no parameters
GET /apis/test/query
id treesinbox
Submit treesinbox query with all the parameters set
GET /apis/test/query
id treesinbox
lngwest -5
lngeast -4
latnorth 41
latsouth 40
limit 10
offset 0
Retrieve one of the trees found
GET /apis/test/resource
id Tree
iri https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/05-0810-A-4-13
GET /apis/test/query
id treesinbox
lngwest -5
lngeast -40 (!)
https://crafts.gsic.uva.es/apis/test/query?id=treesinbox&lngwest=-5&lngeast=-40Changes from previous step
{
"apiId": "test",
"endpoints": [
{
"id": "crossforest",
"sparqlURI": "https://forestexplorer.gsic.uva.es/sparql/",
"graphURI": "http://crossforest.eu",
"httpMethod": "GET"
}
],
"model": [
{
"id": "Tree",
"oprops": [
{
"label": "position",
"targetId": "Position",
"iri": "http://crossforest.eu/position/ontology/hasPosition",
"embed": true,
"restrictions": [
"?value <http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem> <http://epsg.w3id.org/data/crs/4326> ."
],
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "dbh1mm",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasDBH1InMillimeters",
"endpoint": "crossforest"
},
{
"label": "dbh2mm",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasDBH2InMillimeters",
"endpoint": "crossforest"
},
{
"label": "heightM",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasTotalHeightInMeters",
"endpoint": "crossforest"
}
],
"types": [
{
"label": "species",
"targetId": "Species",
"embed": true,
"endpoint": "crossforest"
}
]
},
{
"id": "Position",
"oprops": [
{
"label": "crs",
"iri": "http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem",
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "latWGS84",
"iri": "http://epsg.w3id.org/ontology/axis/1",
"endpoint": "crossforest"
},
{
"label": "lngWGS84",
"iri": "http://epsg.w3id.org/ontology/axis/2",
"endpoint": "crossforest"
}
],
"types": []
},
{
"id": "Species",
"oprops": [ ],
"dprops": [
{
"label": "scientificName",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasAcceptedName>/<https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/name",
"endpoint": "crossforest"
},
{
"label": "vulgarName",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/vulgarName",
"endpoint": "crossforest"
}
],
"types": []
}
],
"queryTemplates": [
{
"id": "treesinbox",
"description": "Obtain trees (variable \"tree\") and their coordinates (variables \"tlat\", \"tlng\") in a box (parameters \"lngwest\", \"lngeast\", \"latsouth\", \"latnorth\"). This template query can be paginated with the optional parameters \"limit\" and \"offset\"",
"template": "SELECT DISTINCT ?tree ?tlat ?tlng WHERE {\n?tree a <https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/Tree> ;\n <http://crossforest.eu/position/ontology/hasPosition> ?pos .\n?pos <http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem> <http://epsg.w3id.org/data/crs/4326> ;\n <http://epsg.w3id.org/ontology/axis/1> ?tlat ;\n <http://epsg.w3id.org/ontology/axis/2> ?tlng .\n{{#latsouth}} FILTER (?tlat > {{latsouth}}) .\n{{/latsouth}}{{#latnorth}} FILTER (?tlat < {{latnorth}}) .\n{{/latnorth}}{{#lngwest}} FILTER (?tlng > {{lngwest}}) .\n{{/lngwest}}{{#lngeast}} FILTER (?tlng < {{lngeast}}) .\n{{/lngeast}}} \n{{#limit}}LIMIT {{limit}}{{/limit}}{{^limit}}LIMIT 100{{/limit}}{{#offset}}\nOFFSET {{offset}}{{/offset}}",
"variables": [
"tree",
"tlat",
"tlng"
],
"parameters": [
{
"label": "lngwest",
"type": "number",
"optional": true
},
{
"label": "lngeast",
"type": "number",
"optional": true
},
{
"label": "latnorth",
"type": "number",
"optional": true
},
{
"label": "latsouth",
"type": "number",
"optional": true
},
{
"label": "limit",
"type": "integer",
"optional": true
},
{
"label": "offset",
"type": "integer",
"optional": true
}
],
"endpoint": "crossforest"
}
]
}
Publish this API
PUT /apis/test
(include the configuration above in the body request)
Retrieve some sample trees
GET /apis/test/resources
id Tree
iris https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/06-0035-A-1-5
iris https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/05-0810-A-4-13
iris https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/05-0093-A-3C-6
Changes from previous step
{
"apiId": "test",
"endpoints": [
{
"id": "crossforest",
"sparqlURI": "https://forestexplorer.gsic.uva.es/sparql/",
"graphURI": "http://crossforest.eu",
"httpMethod": "GET"
},
{
"id": "dbpedia",
"sparqlURI": "http://dbpedia.org/sparql",
"graphURI": "http://dbpedia.org",
"httpMethod": "GET"
}
],
"model": [
{
"id": "Tree",
"oprops": [
{
"label": "position",
"targetId": "Position",
"iri": "http://crossforest.eu/position/ontology/hasPosition",
"embed": true,
"restrictions": [
"?value <http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem> <http://epsg.w3id.org/data/crs/4326> ."
],
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "dbh1mm",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasDBH1InMillimeters",
"endpoint": "crossforest"
},
{
"label": "dbh2mm",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasDBH2InMillimeters",
"endpoint": "crossforest"
},
{
"label": "heightM",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasTotalHeightInMeters",
"endpoint": "crossforest"
}
],
"types": [
{
"label": "species",
"targetId": "Species",
"embed": true,
"restrictions": [
"?type rdfs:subClassOf+ <https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/Plantae> ."
],
"endpoint": "crossforest"
}
]
},
{
"id": "Position",
"oprops": [
{
"label": "crs",
"iri": "http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem",
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "latWGS84",
"iri": "http://epsg.w3id.org/ontology/axis/1",
"endpoint": "crossforest"
},
{
"label": "lngWGS84",
"iri": "http://epsg.w3id.org/ontology/axis/2",
"endpoint": "crossforest"
}
],
"types": []
},
{
"id": "Species",
"oprops": [
{
"label": "dbpedia",
"targetId": "DbpediaSpecies",
"iri": "http://schema.org/sameAs",
"restrictions": [
"FILTER contains(str(?value), \"dbpedia\" )"
],
"embed": true,
"endpoint": "crossforest"
}
],
"dprops": [
{
"label": "scientificName",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/hasAcceptedName>/<https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/name",
"endpoint": "crossforest"
},
{
"label": "vulgarName",
"iri": "https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/vulgarName",
"endpoint": "crossforest"
}
],
"types": []
},
{
"id": "DbpediaSpecies",
"oprops": [
{
"label": "image",
"iri": "http://dbpedia.org/ontology/thumbnail",
"endpoint": "dbpedia"
}
],
"dprops": [
{
"label": "comment",
"iri": "http://www.w3.org/2000/01/rdf-schema#comment",
"restrictions": [
"FILTER (lang(?value) = \"es\" OR lang(?value) = \"en\" OR lang(?value) = \"\")"
],
"endpoint": "dbpedia"
}
],
"types": []
}
],
"queryTemplates": [
{
"id": "treesinbox",
"description": "Obtain trees (variable \"tree\"), their species (variable \"tsps\") and their coordinates (variables \"tlat\", \"tlng\") in a box (parameters \"lngwest\", \"lngeast\", \"latsouth\", \"latnorth\") of species \"species\". This template query can be paginated with the optional parameters \"limit\" and \"offset\"",
"template": "SELECT DISTINCT ?tree ?tsps ?tlat ?tlng WHERE {\n?tree a <https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/Tree>, ?tsps ;\n <http://crossforest.eu/position/ontology/hasPosition> ?pos .\n?pos <http://crossforest.eu/position/ontology/hasCoordinateReferenceSystem> <http://epsg.w3id.org/data/crs/4326> ;\n <http://epsg.w3id.org/ontology/axis/1> ?tlat ;\n <http://epsg.w3id.org/ontology/axis/2> ?tlng .\n?tsps rdfs:subClassOf+ <https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/Plantae> .\n{{#species}} FILTER (?tsps IN (<{{{species}}}>)) .\n{{/species}}{{#latsouth}} FILTER (?tlat > {{latsouth}}) .\n{{/latsouth}}{{#latnorth}} FILTER (?tlat < {{latnorth}}) .\n{{/latnorth}}{{#lngwest}} FILTER (?tlng > {{lngwest}}) .\n{{/lngwest}}{{#lngeast}} FILTER (?tlng < {{lngeast}}) .\n{{/lngeast}}} \n{{#limit}}LIMIT {{limit}}{{/limit}}{{^limit}}LIMIT 100{{/limit}}{{#offset}}\nOFFSET {{offset}}{{/offset}}",
"variables": [
"tree",
"tlat",
"tlng",
"tsps"
],
"parameters": [
{
"label": "species",
"type": "iri",
"optional": true
},
{
"label": "lngwest",
"type": "number",
"optional": true
},
{
"label": "lngeast",
"type": "number",
"optional": true
},
{
"label": "latnorth",
"type": "number",
"optional": true
},
{
"label": "latsouth",
"type": "number",
"optional": true
},
{
"label": "limit",
"type": "integer",
"optional": true
},
{
"label": "offset",
"type": "integer",
"optional": true
}
],
"endpoint": "crossforest"
}
]
}
Publish this API
PUT /apis/test
(include the configuration above in the body request)
Retrieve some sample trees
GET /apis/test/resources
id Tree
iris https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/06-0035-A-1-5
iris https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/05-0810-A-4-13
iris https://datos.iepnb.es/recurso/sector-publico/medio-ambiente/ifn/tree/05-0093-A-3C-6
GET /apis/test/query
id treesinbox
species https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/Species26
limit 10
offset 0
https://crafts.gsic.uva.es/apis/test/query?id=treesinbox&species=https://datos.iepnb.es/def/sector-publico/medio-ambiente/ifn/Species26&limit=10&offset=0