Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to construct graph object #138

Closed
Spothedog1 opened this issue Jul 10, 2024 · 2 comments
Closed

How to construct graph object #138

Spothedog1 opened this issue Jul 10, 2024 · 2 comments

Comments

@Spothedog1
Copy link

Spothedog1 commented Jul 10, 2024

Say I have the following CSV:

id, title, geometry
1, 'feature 1', 'POLYGON(...)'
2, 'feature 2', 'POLYGON(...)'

I'm trying to turn this into a geosparql compatible graph. Each row in the CSV would have to look like:

ex:1
    a geo:Feature ;
    skos:prefLabel "feature 1" ;
    geo:hasGeometry [
        geo:asWKT "POLYGON(...)"^^geo:wktLiteral ;
    ] ;

The graph would look like

graph LR
    A((eg:1)) -->|rdf:type| B((geo:Feature))
    A -->|skos:prefLabel| C(("feature 1"))
    A -->|geo:hasGeometry| D((BlankNode))
    D -->|geo:asWKT| E(("POLYGON (...)"))
Loading

I'm stuck on how I would generate a blank node that points to the WKT

@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix over: <http://overturemaps.org#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix ex: <http://example.org/#> .

<feature> a rml:TriplesMap;

    rml:logicalSource [
        a rml:LogicalSource;
        rr:sqlVersion rr:SQL2008;
    ];

    rml:subjectMap [
        rml:template "http://example.org/#{id}" ;
        rml:class geo:Feature;
    ];

    rml:predicateObjectMap [
        rml:predicate skos:prefLabel ;
        rml:objectMap [ rml:reference "title" ]
    ];

    rr:predicateObjectMap [
        rr:predicate geo:hasGeometry;
        rr:objectMap [
#.           TODO: How would this work?
#            rr:parentTriplesMap <#GeometryMap>
          rml:termType: rml:BlankNode
        ]
    ]
.

How would I generate the triple?

<blank_node from objectMap> geo:asWKT "POLYGON(...)"^^geo:wktLiteral ;

@dachafra
Copy link
Member

Sorry, this is not an issue for the spec. it's a question about how to do things. Please, open it in the proper repository (rml-questions --> discussions)

@Spothedog1
Copy link
Author

Ok will do, haven't seen a separate repo for Discussions only before so didn't know where to put it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants