Download presentation
Presentation is loading. Please wait.
Published byMacie Bathurst Modified over 9 years ago
1
How We Use Epimorphics Linked Data API (ELDA) in Costal and Marine Spatial Planning Vocabulary project Linyun Fu 2013-03-06
2
Linked Data API ELDA Stands for Epimorphics Linked Data API – Java open-source implementation Linked Data API Specification: http://code.google.com/p/linked-data- api/wiki/Specification http://code.google.com/p/linked-data- api/wiki/Specification – http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocabs http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocabs – http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims – http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims/te rm/0008 http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims/te rm/0008 – http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims/te rms http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims/te rms – http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims/te rm/0008/narrower http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims/te rm/0008/narrower
3
ELDA Linked data API introduction by Epimorphics Ltd.: http://www.epimorphics.com/web/projects/linked-data- api http://www.epimorphics.com/web/projects/linked-data- api Downloadable from http://code.google.com/p/elda/downloads/list http://code.google.com/p/elda/downloads/list java -jar elda-VERSION.jar Quick start doc: http://elda.googlecode.com/hg/deliver- elda/src/main/webapp/lda-assets/docs/E1.2.19- index.htmlhttp://elda.googlecode.com/hg/deliver- elda/src/main/webapp/lda-assets/docs/E1.2.19- index.html Installing CMSPV Vocabulary Service: http://tw.rpi.edu/web/project/CMSPV/InstallingVocabul aryService http://tw.rpi.edu/web/project/CMSPV/InstallingVocabul aryService
4
System architecture
5
Next steps Identifying an endpoint Binding variables Selecting resources Viewing resources Formatting graphs All done with spec files
6
Spec files sample spec file: https://scm.escience.rpi.edu/svn/public/projects/cmspv/branch es/elda/specs/cmspv.spec.ttl https://scm.escience.rpi.edu/svn/public/projects/cmspv/branch es/elda/specs/cmspv.spec.ttl in /{path/to}/Elda_standalone_{version}/webapps/elda/WEB- INF/web.xml: loader-init com.epimorphics.lda.routing.Loader com.epimorphics.api.initialSpecFile cmspv::specs/cmspv.spec.ttl 1
7
Identifying an endpoint spec:api a api:API;... api:sparqlEndpoint ; #api:sparqlEndpoint api:base "http://aquarius.tw.rpi.edu:8047/elda/cmspv";... api:variable [api:name "base"; api:value "http://cmspv.tw.rpi.edu/rdf"],...
8
Binding variables spec:api a api:API;... api:sparqlEndpoint ; #api:sparqlEndpoint api:base "http://aquarius.tw.rpi.edu:8047/elda/cmspv";... api:variable [api:name "base"; api:value "http://cmspv.tw.rpi.edu/rdf"],...
9
Selecting resources spec:vocabulariesEndpoint a api:ListEndpoint; api:uriTemplate "/vocabs"; api:exampleRequestPath "/vocabs"; api:selector [ api:where "?item rdf:type skos:ConceptScheme. ?item skos:prefLabel ?label."; api:orderBy "?label"; ];. http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocabs api:base is "http://aquarius.tw.rpi.edu:8047/elda/cmspv"
10
More examples spec:vocabularyEndpoint a api:ItemEndpoint; api:uriTemplate "/vocab/{vocabulary}"; api:itemTemplate "{base}/vocab/{vocabulary}"; api:exampleRequestPath "/vocab/nims";. http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims shows resource: http://cmspv.tw.rpi.edu/rdf/vocab/nims {base} = http://cmspv.tw.rpi.edu/rdf; {vocabulary} = nims
11
spec:termEndpoint a api:ItemEndpoint; api:uriTemplate "/vocab/{vocabulary}/term/{term}"; api:itemTemplate "{base}/vocab/{vocabulary}/term/{term}"; api:exampleRequestPath "/vocab/nims/term/0008";. http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims/te rm/0008
12
spec:vocabularyTermsEndpoint a api:ListEndpoint; rdfs:comment "I am making an assumption that I can easily map the scheme URI based on the Linked Data URI"; api:uriTemplate "/vocab/{vocabulary}/terms"; api:exampleRequestPath "/vocab/nims/terms"; api:variable [ api:name "scheme"; api:value "{base}/vocab/{vocabulary}"; api:type rdfs:Resource; ] ; api:selector [ api:where "?item skos:inScheme ?scheme. ?item skos:prefLabel ?label."; api:orderBy "?label"; ] ;. http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims/terms
13
spec:NarrowerTermsEndpoint a api:ListEndpoint; api:uriTemplate "/vocab/{vocabulary}/term/{term}/narrower"; api:exampleRequestPath "/vocab/nims/term/0008/narrower"; api:variable [ api:name "concept"; api:value "{base}/vocab/{vocabulary}/term/{term}"; api:type rdfs:Resource; ] ; api:selector [ api:where "?concept skos:narrower ?item. ?item skos:prefLabel ?label."; api:orderBy "?label"; ] ;. http://aquarius.tw.rpi.edu:8047/elda/cmspv/vocab/nims/term/0008/narrower
14
Viewing resources, formatting graphs spec:SKOSViewer a api:Viewer; api:name "SKOS Viewer"; api:include api:labelledDescribeViewer; extras:describeAllLabel skos:prefLabel;. spec:htmlFormatter a api:XsltFormatter; api:name "html"; api:mimeType "text/html; charset=utf-8"; api:stylesheet "lda-assets/xslt/cmspv.xsl";.
15
A broader chain viewer spec:broaderChainViewer a api:Viewer; api:name "Broader Chain Viewer"; api:include api:describeViewer; api:properties "prefLabel, broader.prefLabel, broader.broader.prefLabel, broader.broader.broader.prefLabel". … spec:broaderChainEndpoint a api:ItemEndpoint; api:uriTemplate "/vocab/{vocabulary}/term/{term}/broaderChain"; api:itemTemplate "{base}/vocab/{vocabulary}/term/{term}"; api:exampleRequestPath "/vocab/nims/term/0038/broaderChain"; api:defaultViewer spec:broaderChainViewer;.
16
Don’t forget spec:api a api:API; … api:viewer spec:broaderChainViewer, … api:endpoint spec:broaderChainEndpoint, … skos:broader a rdf:Property; api:label "broader";. skos:prefLabel a rdf:Property; api:label "prefLabel";.
17
/vocab/nims/term/0032/broaderChain
18
Using Fuseki assembler cmspv-assembler.ttl: @prefix rdf:. @prefix rdfs:. @prefix ja:. a ja:RDFDataset ; ja:defaultGraph [ a ja:OntModel ; ja:ontModelSpec ja:OWL_MEM_MICRO_RULE_INF ; ja:content [ja:externalContent, ] ]. Run fuseki with: fuseki-server --desc=cmspv-assembler.ttl /cmspv
19
Cherry-pick the rules @prefix rdf:. @prefix rdfs:. @prefix ja:. @prefix :. a ja:RDFDataset ; ja:graph :inf. :inf a ja:InfModel ; ja:baseModel :data ; ja:reasoner [ ja:reasonerURL ; ja:rulesFrom ]. :data a ja:MemoryModel ; ja:content [ja:externalContent, ].
20
The rules file # RDFS Closure rules [rdfs6: (?p rdfs:subPropertyOf ?q), notEqual(?p,?q) -> table(?p, ?q), [ (?a ?q ?b) <- (?a ?p ?b)] ] # inverseOf [inverseOf1: (?P owl:inverseOf ?Q) -> (?Q owl:inverseOf ?P) ] [inverseOf2: (?P owl:inverseOf ?Q) -> table(?P), table(?Q), [inverseOf2b: (?X ?P ?Y) <- (?Y ?Q ?X)] ] # TransitiveProperty [transitiveProperty1: (?P rdf:type owl:TransitiveProperty) -> table(?P), [transitiveProperty1b: (?A ?P ?C) <- bound (?C), (?B ?P ?C), (?A ?P ?B)] [transitiveProperty1b: (?A ?P ?C) <- unbound (?C), (?A ?P ?B) (?B ?P ?C)] ] # SymmetricProperty [symmetricProperty1: (?P rdf:type owl:SymmetricProperty) -> table(?P), [symmetricProperty1b: (?X ?P ?Y) <- (?Y ?P ?X)] ]
21
Direct access SPARQL endpoint: http://aquarius.tw.rpi.edu:3047/post.html http://aquarius.tw.rpi.edu:3047/post.html RDF file: https://scm.escience.rpi.edu/svn/public/proje cts/cmspv/branches/initial_rdf/skos/nims.ttl https://scm.escience.rpi.edu/svn/public/proje cts/cmspv/branches/initial_rdf/skos/nims.ttl
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.