Getting Started#
The tutorial in this section creates a Spring Boot personal (i.e.,
single-user) Web service [1] on
http://localhost:8080
that uses Inrupt’s Java client library to:
Read the Pod URL(s) associated with the user’s WebID. A WebID is a URL that identifies a user and dereferences to the user’s WebID profile document, which contains the Pod URL.
Store and manage expense records in the user’s Pod. The expense records are stored as Resource Description Framework (RDF) resource. An RDF resource is a file whose contents consist of statements, also known as triples, that describe some “subject” by its relationships (shown in Turtle format):
<subject> <predicate> <object> .
The predicate describes the relationship between the subject and the object. That is,
flowchart LR subgraph something id1((subject)) end subgraph this value id2((object)) end id1 --predicate/has some property with --> id2For this part of the tutorial, an expense record (with date, description, provider, amount, currency, category information) is stored as a file in the Pod with the following structure and sample values (shown in Turtle):
<https://storage.example.com/{rootContainer}/expenses/20230306/teamLunchExpense> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://schema.org/Invoice> ; <https://schema.org/purchaseDate> "2023-03-07T00:00:00Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; <https://schema.org/provider> "Example Restaurant" ; <https://schema.org/description> "Team Lunch"; <https://schema.org/category> "Travel and Entertainment" ; <https://schema.org/priceCurrency> "USD" ; <https://schema.org/totalPrice> "120"^^<http://www.w3.org/2001/XMLSchema#decimal> .
Note
The
subject
and thepredicates
are URLs.The
object
may be URLs or literals.
Attach a receipt to the expense:
Store the receipt (as a non-RDF
.png
,.pdf
, or.jpeg
file) to the user’s Pod.Update the the Expense resource by adding a link to the saved receipt file.
<https://storage.example.com/{rootContainer}/expenses/20230306/teamLunchExpense> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://schema.org/Invoice> ; <https://schema.org/purchaseDate> "2023-03-07T00:00:00Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> ; <https://schema.org/provider> "Example Restaurant" ; <https://schema.org/description> "Team Lunch"; <https://schema.org/category> "Travel and Entertainment" ; <https://schema.org/priceCurrency> "USD" ; <https://schema.org/totalPrice> "120"^^<http://www.w3.org/2001/XMLSchema#decimal> ; <https://schema.org/image> <https://storage.example.com/{rootContainer}/expenses/20230306/teamLunchExpense_somerandomsuffix.jpg> .