SlideShare une entreprise Scribd logo
1  sur  30
Yokohama Art Spot meets SPARQL


7/23/2011




            LinkedData.jp
✦

✦ twitter: @wintermelon
✦                         2011   4
✦

✦ LODAC

✦4        SPARQL
LODAC (Linked Open Data for ACademia)
✦ http://lod.ac
✦                                     Web


✦
    ✴              Linked Data(LOD)


    ✴

    ✴

✦
    ✴

    ✴ LODAC
LODAC Museum
✦
    ✴          LOD

✦
    ✴                 RDF

    ✴

    ✴                LOD

    ✴

✦
    ✴

    ✴ LODAC
LODAC Museum
✦
    ✴

    ✴

    ✴

    ✴      DBpedia Lite

    ✴ 15                  → 70

✦              13035604
✦ SPARQL                  http://lod.ac/sparql
Yokohama Art Spot
✦ http://lod.ac/apps/yas/
✦

✦ LODAC                ×    LOD
✦ LODAC
Yokohama Art Spot
1.
2.
3.




1.
2.


3.
1.
2.
3.




1.
2.


3.
✦       ID


    ✴

    ✴

    ✴

    ✴

    ✴

    ✴
Yokohama Art Spot

                    q_spt = """
                        PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-
                    ns#>
                        PREFIX foaf: <http://xmlns.com/foaf/0.1/>
                         PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
                         PREFIX dc: <http://purl.org/dc/terms/>
                        PREFIX omgeo: <http://www.ontotext.com/owlim/geo#>
                        PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
                        PREFIX lodac: <http://lod.ac/ns/lodac#>
                        PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>

                        SELECT distinct ?link ?title ?lat ?long ?postalcode ?
                    address ?access
                        WHERE {
                            ?link rdf:type foaf:Organization;
                            rdfs:label ?title;
                            dc:references ?ref
                            .
                            ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s
                    %(SW_long)s);
                            geo:lat ?lat;
                            geo:long ?long;
                            dc:source <http://place.yafjp.org/rdf/>;
                            vcard:postal-code ?postalcode;
                            <http://ocdi.jp/ns/pi#address> ?address
                            .
                            OPTIONAL{
                                ?ref dc:abstract ?access
                                .
                            }
Step1

        q_spt = """
            PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-
        ns#>
            PREFIX foaf: <http://xmlns.com/foaf/0.1/>
             PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
             PREFIX dc: <http://purl.org/dc/terms/>
            PREFIX omgeo: <http://www.ontotext.com/owlim/geo#>
            PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
            PREFIX lodac: <http://lod.ac/ns/lodac#>
            PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>

            SELECT distinct ?link ?title ?lat ?long ?postalcode ?
        address ?access
            WHERE {
                ?link rdf:type foaf:Organization;
                rdfs:label ?title;
                dc:references ?ref
                .
                ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s
        %(SW_long)s);
                geo:lat ?lat;
                geo:long ?long;
                dc:source <http://place.yafjp.org/rdf/>;
                vcard:postal-code ?postalcode;
                <http://ocdi.jp/ns/pi#address> ?address
                .
                OPTIONAL{
                    ?ref dc:abstract ?access
                    .
                }
Step2                                                                                         &

                           q_spt = """
                               PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-
                           ns#>
                               PREFIX foaf: <http://xmlns.com/foaf/0.1/>
                                PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
                                PREFIX dc: <http://purl.org/dc/terms/>
                               PREFIX omgeo: <http://www.ontotext.com/owlim/geo#>
                               PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
                               PREFIX lodac: <http://lod.ac/ns/lodac#>
                               PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>

                               SELECT distinct ?link ?title ?lat ?long ?postalcode ?
                           address ?access
                               WHERE {
                                   ?link rdf:type foaf:Organization;
                                   rdfs:label ?title;
                                   dc:references ?ref
                                   .
                                   ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s
                           %(SW_long)s);
                                   geo:lat ?lat;
                                   geo:long ?long;
                                   dc:source <http://place.yafjp.org/rdf/>;
                                   vcard:postal-code ?postalcode;
                                   <http://ocdi.jp/ns/pi#address> ?address
                                   .
                                   OPTIONAL{
                                       ?ref dc:abstract ?access
                                       .
                                   }




Python + SPARQLWrapper (http://sparql-wrapper.sourceforge.net/)

 from SPARQLWrapper import SPARQLWrapper, JSON

 sparql_wrapper = SPARQLWrapper(SPARQL                                                            URL)
 query = SPARQL
 sparql_wrapper.setQuery(query)
 sparql_wrapper.setReturnFormat(JSON)
 results = sparql_wrapper.query().convert()


                                                                                         SPARQL
Step2-1

          q_spt = """
              PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
              PREFIX foaf: <http://xmlns.com/foaf/0.1/>
              PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
              PREFIX dc: <http://purl.org/dc/terms/>
              PREFIX omgeo: <http://www.ontotext.com/owlim/geo#>
              PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
              PREFIX lodac: <http://lod.ac/ns/lodac#>
              PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>

              SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access
              WHERE {
                  ?link rdf:type foaf:Organization;
                  rdfs:label ?title;
                  dc:references ?ref
                  .
                  ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s);
                  geo:lat ?lat;
                  geo:long ?long;
                  dc:source <http://place.yafjp.org/rdf/>;
                  vcard:postal-code ?postalcode;
                  <http://ocdi.jp/ns/pi#address> ?address
                  .
                  OPTIONAL{
                      ?ref dc:abstract ?access
                      .
                  }
              }
              """ % locals()
PREFIX   rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
 PREFIX   foaf: <http://xmlns.com/foaf/0.1/>
 PREFIX   rdfs: <http://www.w3.org/2000/01/rdf-schema#>
 PREFIX   dc: <http://purl.org/dc/terms/>
 PREFIX   omgeo: <http://www.ontotext.com/owlim/geo#>
 PREFIX   geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
 PREFIX   lodac: <http://lod.ac/ns/lodac#>
 PREFIX   vcard: <http://www.w3.org/2006/vcard/ns#>



PREFIX

 ?link <http://purl.org/dc/terms/references> ?ref .




 ?link dc:references ?ref .
q_spt = """
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX dc: <http://purl.org/dc/terms/>
    PREFIX omgeo: <http://www.ontotext.com/owlim/geo#>
    PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
    PREFIX lodac: <http://lod.ac/ns/lodac#>
    PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>

    SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access
    WHERE {
        ?link rdf:type foaf:Organization;
        rdfs:label ?title;
        dc:references ?ref
        .
        ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s);
        geo:lat ?lat;
        geo:long ?long;
        dc:source <http://place.yafjp.org/rdf/>;
        vcard:postal-code ?postalcode;
        <http://ocdi.jp/ns/pi#address> ?address
        .
        OPTIONAL{
            ?ref dc:abstract ?access
            .
        }
    }
    """ % locals()
SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access
WHERE {
    ?link rdf:type foaf:Organization;          ?
    rdfs:label ?title;
    dc:references ?ref
    .
    ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s);
    geo:lat ?lat;
    geo:long ?long;                              ?    ?    ?      ;
    dc:source <http://place.yafjp.org/rdf/>;
                                                 ?    ?     ;
    vcard:postal-code ?postalcode;
    <http://ocdi.jp/ns/pi#address> ?address      ?    ?
    .                                            .
    OPTIONAL{
        ?ref dc:abstract ?access
        .
    }
}
SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access
WHERE {
    ?link rdf:type foaf:Organization;
    rdfs:label ?title;
    dc:references ?ref                               SELECT
    .
                                               ?link               URI
    ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s);
    geo:lat ?lat;                              ?title
    geo:long ?long;                            ?lat
    dc:source <http://place.yafjp.org/rdf/>;
    vcard:postal-code ?postalcode;
                                               ?long
    <http://ocdi.jp/ns/pi#address> ?address    ?postalcode
    .                                          ?address
    OPTIONAL{
                                               ?access
        ?ref dc:abstract ?access
        .
    }
}
SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access
WHERE {
    ?link rdf:type foaf:Organization;
    rdfs:label ?title;                      1.
    dc:references ?ref                                   ?link
    .
    ?ref omgeo:within(%(NE_lat)s %(NE_long)s2. ?link
                                             %(SW_lat)s %(SW_long)s);
    geo:lat ?lat;
    geo:long ?long;                            ?title
    dc:source <http://place.yafjp.org/rdf/>; ?ref
    vcard:postal-code ?postalcode;
    <http://ocdi.jp/ns/pi#address> ?address ※ LODAC      ?link
    .
                                               1      ?ref
    OPTIONAL{
        ?ref dc:abstract ?access               ?ref
        .
    }
}                                           3.        ?ref
LODAC                                                             2

                             crm:P55_has_current_location         dc:creator

                          dc:references                                        dc:references



             crm:P55_has_current_location                                 crm:P55_has_current_location
                                            dc:references           dc:references                        dc:creator
dc:creator



                              dc:references                                     dc:references




                                                            URI
                                                            URI
LODAC                                                             2

                             crm:P55_has_current_location         dc:creator

                          dc:references                                        dc:references



             crm:P55_has_current_location                                 crm:P55_has_current_location
                                            dc:references           dc:references                        dc:creator
dc:creator



                              dc:references                                     dc:references




                                                            URI
                                                            URI
SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access
WHERE {
    ?link rdf:type foaf:Organization;
    rdfs:label ?title;
    dc:references ?ref
    .
    ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s);
    geo:lat ?lat;
    geo:long ?long;
    dc:source <http://place.yafjp.org/rdf/>;
    vcard:postal-code ?postalcode; GET
    <http://ocdi.jp/ns/pi#address> ?address
    .                                                ?ref
    OPTIONAL{
        ?ref dc:abstract ?access
        .
    }
}
omgeo?
✦                         ?ref
    ?ref geo:lat ?lat;
    geo:long ?long.

    FILTER(?lat < 35.432916 && ?lat > 35.475012 &&
           ?long < 139.608699 && ?long > 139.652644)




✦ omgeo                     1

    ?ref omgeo:within(35.475012 139.652644 35.439216 139.608699).



    ✴ OWLIM
        virtuoso

    ✴              ●●km
SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access
WHERE {
    ?link rdf:type foaf:Organization;
    rdfs:label ?title;
    dc:references ?ref
    .
    ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s);
    geo:lat ?lat;
    geo:long ?long;
    dc:source <http://place.yafjp.org/rdf/>;
    vcard:postal-code ?postalcode;
    <http://ocdi.jp/ns/pi#address> ?address
    .
    OPTIONAL{
        ?ref dc:abstract ?access
                                   <http://place.yafjp.org/rdf/>
        .
    }
}
                           ?lat           ?postalcode
                           ?long          ?address
SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access
WHERE {
    ?link rdf:type foaf:Organization;
    rdfs:label ?title;
    dc:references ?ref
    .
    ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s);
    geo:lat ?lat;
    geo:long ?long;
    dc:source <http://place.yafjp.org/rdf/>;dc:abstract
                                      ?ref
    vcard:postal-code ?postalcode;               ?access
    <http://ocdi.jp/ns/pi#address> ?address
    .                                   OPTIONAL
    OPTIONAL{
        ?ref dc:abstract ?access
        .
    }
}
SPARQL                                      JSON

 {"spt": {"head": {"vars": ["link", "title", "lat", "long", "postalcode",
 "address", "access"]}, "results": {"bindings": [{"title": {"xml:lang": "ja",
 "type": "literal", "value": "u6a2au6d5cu7f8eu8853u9928"}, "long":
 {"datatype": "http://www.w3.org/2001/XMLSchema#float", "type": "typed-literal",
 "value": "139.63044"}, "access": {"type": "literal", "value": "u685cu6728u753a
 u99c5(JR)u4e0bu8ecau3001u52d5u304f
 u6b69u9053u3092u5229u7528u5f92u6b6910u5206u3002u307fu306au3068u307f
 u3089u3044u99c5(u307fu306au3068u307fu3089u3044u7dda)u4e0bu8eca
 u3001u300cu7f8eu8853u9928u53e3u300du3092u51fa
 u3066u5f92u6b693u5206u3002"}, "postalcode": {"type": "literal", "value":
 "220-0012"}, "link": {"type": "uri", "value": "http://lod.ac/id/3172"},
 "address": {"xml:lang": "ja", "type": "literal", "value": "u6a2au6d5c
 u5e02u897fu533au307fu306au3068u307fu3089u30443u4e01u76ee4-1"}, "lat":
 {"datatype": "http://www.w3.org/2001/XMLSchema#float", "type": "typed-literal",
 "value": "35.45722"}}, {"title": {"xml:lang": "ja", "type": "literal", "value":
 "u307fu306au3068u307fu3089u3044u30aeu30e3u30e9u30eau30fc"}, "long":
 {"datatype": "http://www.w3.org/2001/XMLSchema#float", "type": "typed-literal",
 "value": "139.6341"}, "postalcode": {"type": "literal", "value": "220-0012"},
 "link": {"type": "uri", "value": "http://lod.ac/id/530977"}, "address":
 {"xml:lang": "ja", "type": "literal", "value": "u795eu5948u5dddu770cu6a2a
 u6d5cu5e02u897fu533au307fu306au3068u307fu3089u30442u4e01u76ee3-5"},
 "lat": {"datatype": "http://www.w3.org/2001/XMLSchema#float", "type": "typed-
                                        …
SPARQL




         …
Step2-2
✦                                    ?link
    ?link ical:dtstart ?dtstart ;
    ical:dtend ?dtend .
    FILTER (
        (?dtstart > "%(dtstart)s"^^xsd:dateTime
         && ?dtstart < "%(dtend)s"^^xsd:dateTime)
         ||
        (?dtend > "%(dtstart)s"^^xsd:dateTime
         && ?dtend < "%(dtend)s"^^xsd:dateTime)
         ||
        (?dtstart < "%(dtstart)s"^^xsd:dateTime
         && ?dtend > "%(dtend)s"^^xsd:dateTime)
    )



✦                  …        dateTime         FILTER   0
        Sesame
Step3

                   q_spt = """
                       PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-
                   ns#>
                       PREFIX foaf: <http://xmlns.com/foaf/0.1/>
                        PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
                        PREFIX dc: <http://purl.org/dc/terms/>
                       PREFIX omgeo: <http://www.ontotext.com/owlim/geo#>
                       PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
                       PREFIX lodac: <http://lod.ac/ns/lodac#>
                       PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>

                       SELECT distinct ?link ?title ?lat ?long ?postalcode ?
                   address ?access
                       WHERE {
                           ?link rdf:type foaf:Organization;
                           rdfs:label ?title;
                           dc:references ?ref
                           .
                           ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s
                   %(SW_long)s);
                           geo:lat ?lat;
                           geo:long ?long;
                           dc:source <http://place.yafjp.org/rdf/>;
                           vcard:postal-code ?postalcode;
                           <http://ocdi.jp/ns/pi#address> ?address
                           .
                           OPTIONAL{
                               ?ref dc:abstract ?access
                               .
                           }




1.                                                                               1
2.                                       JSON
3.                        JSON

✦             or
     ON/OFF
✦
SPARQL              LOD
✦


     omgeo:within
✦ Semantic Media Wiki
    →   Wiki                              SPARQL


✦
    DBpedia    GeoNames
✦
                          dc:created
    1990   [1980]   1990        c. 1990   1980-90   55

Contenu connexe

Tendances

Linked data: spreading data over the web
Linked data: spreading data over the webLinked data: spreading data over the web
Linked data: spreading data over the web
shellac
 
Bigdive 2014 - RDF, principles and case studies
Bigdive 2014 - RDF, principles and case studiesBigdive 2014 - RDF, principles and case studies
Bigdive 2014 - RDF, principles and case studies
Diego Valerio Camarda
 

Tendances (12)

Bio2 Rdf Presentation V3
Bio2 Rdf Presentation V3Bio2 Rdf Presentation V3
Bio2 Rdf Presentation V3
 
20100614 ISWSA Keynote
20100614 ISWSA Keynote20100614 ISWSA Keynote
20100614 ISWSA Keynote
 
Cassandra introduction apache con 2014 budapest
Cassandra introduction apache con 2014 budapestCassandra introduction apache con 2014 budapest
Cassandra introduction apache con 2014 budapest
 
Accessing Databases from R
Accessing Databases from RAccessing Databases from R
Accessing Databases from R
 
The Cultural Linked Data Backbone
The Cultural Linked Data BackboneThe Cultural Linked Data Backbone
The Cultural Linked Data Backbone
 
The Cultural Linked Data Backbone
The Cultural Linked Data BackboneThe Cultural Linked Data Backbone
The Cultural Linked Data Backbone
 
Linked data: spreading data over the web
Linked data: spreading data over the webLinked data: spreading data over the web
Linked data: spreading data over the web
 
One PDB to go, please!
One PDB to go, please!One PDB to go, please!
One PDB to go, please!
 
cyclades eswc2016
cyclades eswc2016cyclades eswc2016
cyclades eswc2016
 
Bigdive 2014 - RDF, principles and case studies
Bigdive 2014 - RDF, principles and case studiesBigdive 2014 - RDF, principles and case studies
Bigdive 2014 - RDF, principles and case studies
 
Running R on Hadoop - CHUG - 20120815
Running R on Hadoop - CHUG - 20120815Running R on Hadoop - CHUG - 20120815
Running R on Hadoop - CHUG - 20120815
 
Cassandra introduction @ NantesJUG
Cassandra introduction @ NantesJUGCassandra introduction @ NantesJUG
Cassandra introduction @ NantesJUG
 

En vedette

Linked Open Dataによる博物館情報および地域情報の連携活用(じんもんこん2011)
Linked Open Dataによる博物館情報および地域情報の連携活用(じんもんこん2011)Linked Open Dataによる博物館情報および地域情報の連携活用(じんもんこん2011)
Linked Open Dataによる博物館情報および地域情報の連携活用(じんもんこん2011)
Fuyuko Matsumura
 
外科術後患者の発熱のマネージメント
外科術後患者の発熱のマネージメント外科術後患者の発熱のマネージメント
外科術後患者の発熱のマネージメント
Sentaro Iwabuchi
 
ಮುಹರ್ರಮ್ ಒಂದು ಪವಿತ್ರ ಮಾಸ 2
ಮುಹರ್ರಮ್ ಒಂದು ಪವಿತ್ರ ಮಾಸ 2ಮುಹರ್ರಮ್ ಒಂದು ಪವಿತ್ರ ಮಾಸ 2
ಮುಹರ್ರಮ್ ಒಂದು ಪವಿತ್ರ ಮಾಸ 2
FAHIM AKTHAR ULLAL
 
Translated copy of ch15-16x
Translated copy of ch15-16xTranslated copy of ch15-16x
Translated copy of ch15-16x
desgreene
 
Susan Siegel resume 2016
Susan Siegel resume 2016Susan Siegel resume 2016
Susan Siegel resume 2016
Susan Siegel
 

En vedette (20)

Linked Open Dataによる博物館情報および地域情報の連携活用(じんもんこん2011)
Linked Open Dataによる博物館情報および地域情報の連携活用(じんもんこん2011)Linked Open Dataによる博物館情報および地域情報の連携活用(じんもんこん2011)
Linked Open Dataによる博物館情報および地域情報の連携活用(じんもんこん2011)
 
Blimey - Smart Privacy Controls
Blimey - Smart Privacy ControlsBlimey - Smart Privacy Controls
Blimey - Smart Privacy Controls
 
Vikrama Simha Audio Launch
Vikrama Simha Audio Launch Vikrama Simha Audio Launch
Vikrama Simha Audio Launch
 
Inglesiii
InglesiiiInglesiii
Inglesiii
 
Presentationmiriadax
PresentationmiriadaxPresentationmiriadax
Presentationmiriadax
 
resume 1
resume 1resume 1
resume 1
 
外科術後患者の発熱のマネージメント
外科術後患者の発熱のマネージメント外科術後患者の発熱のマネージメント
外科術後患者の発熱のマネージメント
 
90octane Overview
90octane Overview90octane Overview
90octane Overview
 
C:\fakepath\web 2.0
C:\fakepath\web 2.0C:\fakepath\web 2.0
C:\fakepath\web 2.0
 
ಮುಹರ್ರಮ್ ಒಂದು ಪವಿತ್ರ ಮಾಸ 2
ಮುಹರ್ರಮ್ ಒಂದು ಪವಿತ್ರ ಮಾಸ 2ಮುಹರ್ರಮ್ ಒಂದು ಪವಿತ್ರ ಮಾಸ 2
ಮುಹರ್ರಮ್ ಒಂದು ಪವಿತ್ರ ಮಾಸ 2
 
トーゴーの日2014ポスター
トーゴーの日2014ポスタートーゴーの日2014ポスター
トーゴーの日2014ポスター
 
News SA 47 2016
News SA 47 2016News SA 47 2016
News SA 47 2016
 
9 120614
9 1206149 120614
9 120614
 
Translated copy of ch15-16x
Translated copy of ch15-16xTranslated copy of ch15-16x
Translated copy of ch15-16x
 
Susan Siegel resume 2016
Susan Siegel resume 2016Susan Siegel resume 2016
Susan Siegel resume 2016
 
1 el pensamiento militar
1 el pensamiento militar1 el pensamiento militar
1 el pensamiento militar
 
Linked Open DataチャレンジJapanを中心としたLODの事例紹介
Linked Open DataチャレンジJapanを中心としたLODの事例紹介Linked Open DataチャレンジJapanを中心としたLODの事例紹介
Linked Open DataチャレンジJapanを中心としたLODの事例紹介
 
カークパトリック4レベルと成功事例法を応用した医療教育・訓練
カークパトリック4レベルと成功事例法を応用した医療教育・訓練カークパトリック4レベルと成功事例法を応用した医療教育・訓練
カークパトリック4レベルと成功事例法を応用した医療教育・訓練
 
3 guerras venezolanas
3 guerras venezolanas3 guerras venezolanas
3 guerras venezolanas
 
Introduction to immunology
Introduction to immunologyIntroduction to immunology
Introduction to immunology
 

Similaire à Yokohama Art Spot meets SPARQL

SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)
andyseaborne
 
Creating APIs over RDF
Creating APIs over RDFCreating APIs over RDF
Creating APIs over RDF
Leigh Dodds
 
Creating APIs over RDF
Creating APIs over RDFCreating APIs over RDF
Creating APIs over RDF
Leigh Dodds
 
A hands on overview of the semantic web
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic web
Marakana Inc.
 
SWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQLSWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQL
Mariano Rodriguez-Muro
 

Similaire à Yokohama Art Spot meets SPARQL (20)

Semantic Variation Graphs the case for RDF & SPARQL
Semantic Variation Graphs the case for RDF & SPARQLSemantic Variation Graphs the case for RDF & SPARQL
Semantic Variation Graphs the case for RDF & SPARQL
 
SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)
 
Semantic Web(Web 3.0) SPARQL
Semantic Web(Web 3.0) SPARQLSemantic Web(Web 3.0) SPARQL
Semantic Web(Web 3.0) SPARQL
 
RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031
 
GDG Meets U event - Big data & Wikidata - no lies codelab
GDG Meets U event - Big data & Wikidata -  no lies codelabGDG Meets U event - Big data & Wikidata -  no lies codelab
GDG Meets U event - Big data & Wikidata - no lies codelab
 
Sesam4 project presentation sparql - april 2011
Sesam4   project presentation sparql - april 2011Sesam4   project presentation sparql - april 2011
Sesam4 project presentation sparql - april 2011
 
Sesam4 project presentation sparql - april 2011
Sesam4   project presentation sparql - april 2011Sesam4   project presentation sparql - april 2011
Sesam4 project presentation sparql - april 2011
 
Querying Linked Data
Querying Linked DataQuerying Linked Data
Querying Linked Data
 
Creating APIs over RDF
Creating APIs over RDFCreating APIs over RDF
Creating APIs over RDF
 
Creating APIs over RDF
Creating APIs over RDFCreating APIs over RDF
Creating APIs over RDF
 
A hands on overview of the semantic web
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic web
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQL
 
Intro to Linked, Dutch Ships and Sailors and SPARQL handson
Intro to Linked, Dutch Ships and Sailors and SPARQL handson Intro to Linked, Dutch Ships and Sailors and SPARQL handson
Intro to Linked, Dutch Ships and Sailors and SPARQL handson
 
Bio2RDF@BH2010
Bio2RDF@BH2010Bio2RDF@BH2010
Bio2RDF@BH2010
 
SPARQLing Services
SPARQLing ServicesSPARQLing Services
SPARQLing Services
 
A Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic WebA Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic Web
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
SWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQLSWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQL
 
Data in RDF
Data in RDFData in RDF
Data in RDF
 

Dernier

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Dernier (20)

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

Yokohama Art Spot meets SPARQL

  • 1. Yokohama Art Spot meets SPARQL 7/23/2011 LinkedData.jp
  • 2. ✦ ✦ twitter: @wintermelon ✦ 2011 4 ✦ ✦ LODAC ✦4 SPARQL
  • 3. LODAC (Linked Open Data for ACademia) ✦ http://lod.ac ✦ Web ✦ ✴ Linked Data(LOD) ✴ ✴ ✦ ✴ ✴ LODAC
  • 4. LODAC Museum ✦ ✴ LOD ✦ ✴ RDF ✴ ✴ LOD ✴ ✦ ✴ ✴ LODAC
  • 5. LODAC Museum ✦ ✴ ✴ ✴ ✴ DBpedia Lite ✴ 15 → 70 ✦ 13035604 ✦ SPARQL http://lod.ac/sparql
  • 6. Yokohama Art Spot ✦ http://lod.ac/apps/yas/ ✦ ✦ LODAC × LOD ✦ LODAC
  • 10. ID ✴ ✴ ✴ ✴ ✴ ✴
  • 11. Yokohama Art Spot q_spt = """ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax- ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dc: <http://purl.org/dc/terms/> PREFIX omgeo: <http://www.ontotext.com/owlim/geo#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX lodac: <http://lod.ac/ns/lodac#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> SELECT distinct ?link ?title ?lat ?long ?postalcode ? address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; dc:references ?ref . ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; dc:source <http://place.yafjp.org/rdf/>; vcard:postal-code ?postalcode; <http://ocdi.jp/ns/pi#address> ?address . OPTIONAL{ ?ref dc:abstract ?access . }
  • 12. Step1 q_spt = """ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax- ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dc: <http://purl.org/dc/terms/> PREFIX omgeo: <http://www.ontotext.com/owlim/geo#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX lodac: <http://lod.ac/ns/lodac#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> SELECT distinct ?link ?title ?lat ?long ?postalcode ? address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; dc:references ?ref . ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; dc:source <http://place.yafjp.org/rdf/>; vcard:postal-code ?postalcode; <http://ocdi.jp/ns/pi#address> ?address . OPTIONAL{ ?ref dc:abstract ?access . }
  • 13. Step2 & q_spt = """ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax- ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dc: <http://purl.org/dc/terms/> PREFIX omgeo: <http://www.ontotext.com/owlim/geo#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX lodac: <http://lod.ac/ns/lodac#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> SELECT distinct ?link ?title ?lat ?long ?postalcode ? address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; dc:references ?ref . ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; dc:source <http://place.yafjp.org/rdf/>; vcard:postal-code ?postalcode; <http://ocdi.jp/ns/pi#address> ?address . OPTIONAL{ ?ref dc:abstract ?access . } Python + SPARQLWrapper (http://sparql-wrapper.sourceforge.net/) from SPARQLWrapper import SPARQLWrapper, JSON sparql_wrapper = SPARQLWrapper(SPARQL URL) query = SPARQL sparql_wrapper.setQuery(query) sparql_wrapper.setReturnFormat(JSON) results = sparql_wrapper.query().convert() SPARQL
  • 14. Step2-1 q_spt = """ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dc: <http://purl.org/dc/terms/> PREFIX omgeo: <http://www.ontotext.com/owlim/geo#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX lodac: <http://lod.ac/ns/lodac#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; dc:references ?ref . ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; dc:source <http://place.yafjp.org/rdf/>; vcard:postal-code ?postalcode; <http://ocdi.jp/ns/pi#address> ?address . OPTIONAL{ ?ref dc:abstract ?access . } } """ % locals()
  • 15. PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dc: <http://purl.org/dc/terms/> PREFIX omgeo: <http://www.ontotext.com/owlim/geo#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX lodac: <http://lod.ac/ns/lodac#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> PREFIX ?link <http://purl.org/dc/terms/references> ?ref . ?link dc:references ?ref .
  • 16. q_spt = """ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dc: <http://purl.org/dc/terms/> PREFIX omgeo: <http://www.ontotext.com/owlim/geo#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX lodac: <http://lod.ac/ns/lodac#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; dc:references ?ref . ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; dc:source <http://place.yafjp.org/rdf/>; vcard:postal-code ?postalcode; <http://ocdi.jp/ns/pi#address> ?address . OPTIONAL{ ?ref dc:abstract ?access . } } """ % locals()
  • 17. SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access WHERE { ?link rdf:type foaf:Organization; ? rdfs:label ?title; dc:references ?ref . ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; ? ? ? ; dc:source <http://place.yafjp.org/rdf/>; ? ? ; vcard:postal-code ?postalcode; <http://ocdi.jp/ns/pi#address> ?address ? ? . . OPTIONAL{ ?ref dc:abstract ?access . } }
  • 18. SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; dc:references ?ref SELECT . ?link URI ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; ?title geo:long ?long; ?lat dc:source <http://place.yafjp.org/rdf/>; vcard:postal-code ?postalcode; ?long <http://ocdi.jp/ns/pi#address> ?address ?postalcode . ?address OPTIONAL{ ?access ?ref dc:abstract ?access . } }
  • 19. SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; 1. dc:references ?ref ?link . ?ref omgeo:within(%(NE_lat)s %(NE_long)s2. ?link %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; ?title dc:source <http://place.yafjp.org/rdf/>; ?ref vcard:postal-code ?postalcode; <http://ocdi.jp/ns/pi#address> ?address ※ LODAC ?link . 1 ?ref OPTIONAL{ ?ref dc:abstract ?access ?ref . } } 3. ?ref
  • 20. LODAC 2 crm:P55_has_current_location dc:creator dc:references dc:references crm:P55_has_current_location crm:P55_has_current_location dc:references dc:references dc:creator dc:creator dc:references dc:references URI URI
  • 21. LODAC 2 crm:P55_has_current_location dc:creator dc:references dc:references crm:P55_has_current_location crm:P55_has_current_location dc:references dc:references dc:creator dc:creator dc:references dc:references URI URI
  • 22. SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; dc:references ?ref . ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; dc:source <http://place.yafjp.org/rdf/>; vcard:postal-code ?postalcode; GET <http://ocdi.jp/ns/pi#address> ?address . ?ref OPTIONAL{ ?ref dc:abstract ?access . } }
  • 23. omgeo? ✦ ?ref ?ref geo:lat ?lat; geo:long ?long. FILTER(?lat < 35.432916 && ?lat > 35.475012 && ?long < 139.608699 && ?long > 139.652644) ✦ omgeo 1 ?ref omgeo:within(35.475012 139.652644 35.439216 139.608699). ✴ OWLIM virtuoso ✴ ●●km
  • 24. SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; dc:references ?ref . ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; dc:source <http://place.yafjp.org/rdf/>; vcard:postal-code ?postalcode; <http://ocdi.jp/ns/pi#address> ?address . OPTIONAL{ ?ref dc:abstract ?access <http://place.yafjp.org/rdf/> . } } ?lat ?postalcode ?long ?address
  • 25. SELECT distinct ?link ?title ?lat ?long ?postalcode ?address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; dc:references ?ref . ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; dc:source <http://place.yafjp.org/rdf/>;dc:abstract ?ref vcard:postal-code ?postalcode; ?access <http://ocdi.jp/ns/pi#address> ?address . OPTIONAL OPTIONAL{ ?ref dc:abstract ?access . } }
  • 26. SPARQL JSON {"spt": {"head": {"vars": ["link", "title", "lat", "long", "postalcode", "address", "access"]}, "results": {"bindings": [{"title": {"xml:lang": "ja", "type": "literal", "value": "u6a2au6d5cu7f8eu8853u9928"}, "long": {"datatype": "http://www.w3.org/2001/XMLSchema#float", "type": "typed-literal", "value": "139.63044"}, "access": {"type": "literal", "value": "u685cu6728u753a u99c5(JR)u4e0bu8ecau3001u52d5u304f u6b69u9053u3092u5229u7528u5f92u6b6910u5206u3002u307fu306au3068u307f u3089u3044u99c5(u307fu306au3068u307fu3089u3044u7dda)u4e0bu8eca u3001u300cu7f8eu8853u9928u53e3u300du3092u51fa u3066u5f92u6b693u5206u3002"}, "postalcode": {"type": "literal", "value": "220-0012"}, "link": {"type": "uri", "value": "http://lod.ac/id/3172"}, "address": {"xml:lang": "ja", "type": "literal", "value": "u6a2au6d5c u5e02u897fu533au307fu306au3068u307fu3089u30443u4e01u76ee4-1"}, "lat": {"datatype": "http://www.w3.org/2001/XMLSchema#float", "type": "typed-literal", "value": "35.45722"}}, {"title": {"xml:lang": "ja", "type": "literal", "value": "u307fu306au3068u307fu3089u3044u30aeu30e3u30e9u30eau30fc"}, "long": {"datatype": "http://www.w3.org/2001/XMLSchema#float", "type": "typed-literal", "value": "139.6341"}, "postalcode": {"type": "literal", "value": "220-0012"}, "link": {"type": "uri", "value": "http://lod.ac/id/530977"}, "address": {"xml:lang": "ja", "type": "literal", "value": "u795eu5948u5dddu770cu6a2a u6d5cu5e02u897fu533au307fu306au3068u307fu3089u30442u4e01u76ee3-5"}, "lat": {"datatype": "http://www.w3.org/2001/XMLSchema#float", "type": "typed- …
  • 27. SPARQL
  • 28. Step2-2 ✦ ?link ?link ical:dtstart ?dtstart ; ical:dtend ?dtend . FILTER ( (?dtstart > "%(dtstart)s"^^xsd:dateTime && ?dtstart < "%(dtend)s"^^xsd:dateTime) || (?dtend > "%(dtstart)s"^^xsd:dateTime && ?dtend < "%(dtend)s"^^xsd:dateTime) || (?dtstart < "%(dtstart)s"^^xsd:dateTime && ?dtend > "%(dtend)s"^^xsd:dateTime) ) ✦ … dateTime FILTER 0 Sesame
  • 29. Step3 q_spt = """ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax- ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dc: <http://purl.org/dc/terms/> PREFIX omgeo: <http://www.ontotext.com/owlim/geo#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX lodac: <http://lod.ac/ns/lodac#> PREFIX vcard: <http://www.w3.org/2006/vcard/ns#> SELECT distinct ?link ?title ?lat ?long ?postalcode ? address ?access WHERE { ?link rdf:type foaf:Organization; rdfs:label ?title; dc:references ?ref . ?ref omgeo:within(%(NE_lat)s %(NE_long)s %(SW_lat)s %(SW_long)s); geo:lat ?lat; geo:long ?long; dc:source <http://place.yafjp.org/rdf/>; vcard:postal-code ?postalcode; <http://ocdi.jp/ns/pi#address> ?address . OPTIONAL{ ?ref dc:abstract ?access . } 1. 1 2. JSON 3. JSON ✦ or ON/OFF ✦
  • 30. SPARQL LOD ✦ omgeo:within ✦ Semantic Media Wiki → Wiki SPARQL ✦ DBpedia GeoNames ✦ dc:created 1990 [1980] 1990 c. 1990 1980-90 55