This library brings the LDflex language to Solid.
npm install @solid/query-ldflex
const { node } = require('@solid/query-ldflex');
const ruben = node('https://ruben.verborgh.org/profile/#me');
showProfile(ruben);
async function showProfile(person) {
const label = await person.label;
console.log(`\nNAME: ${label}`);
console.log('\nTYPES');
for await (const type of person.type)
console.log(` - ${type}`);
console.log('\nFRIENDS');
for await (const name of person.friends.firstName)
console.log(` - ${name} is a friend`);
}
<script src="solid-auth-client.bundle.js"></script>
<script src="solid-query-ldflex.bundle.js"></script>
document.addEventListener('DOMContentLoaded', async () => {
const user = solid.data.user;
alert(`Welcome, ${await user.firstName}!`);
});
©2018–present Ruben Verborgh, MIT License.