Tutorial
The tutorial in this section creates a Spring Boot personal (i.e., single-user) Web service on http://localhost:8080
that uses Inrupt’s Java client library to:
Read the Pod URLs associated with the user’s WebID.
Store and manage expense records in the user’s Pod. The expense records are stored as Resource Description Framework (RDF) resource.
For 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> .
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> ;
<strong> <https://schema.org/image> <https://storage.example.com/{rootContainer}/expenses/20230306/teamLunchExpense_somerandomsuffix.jpg> .
Last updated