diff --git a/ng-app/src/apps/ContactEditor.svelte b/ng-app/src/apps/ContactEditor.svelte
index e32c1c4..9791dcd 100644
--- a/ng-app/src/apps/ContactEditor.svelte
+++ b/ng-app/src/apps/ContactEditor.svelte
@@ -90,14 +90,22 @@
}
async function test() {
- if (!has_camera) {
- await on_qr_scanned("AgBPtkD9jg11uDj7FTK0VqWb_aVxYvoyjFyIWs5VwCOICwAAABsxv_FXViA-5LUMNjARLJCiS3nOc7WYdoVQYgWn2ukcB25vIG5hbWUBDmZha2VAZW1haWwuY29t");
- }
+ await on_qr_scanned("AgBX7NyrH_8cF47eeqkkFwtHFi-LrjrxOoRLNM0EScA1NAABANpOlaBYozbkSDVJFAUG2nSWSTXXD-wiLRG6ZUU23f8GCWFjY291bnQgNAEObmlrbzRAdHJ1ZS5jb20");
}
Contact
+
+
+
{#if !has_camera && !has_name}
No camera available. You cannot import with QR-code
{/if}
diff --git a/ng-app/src/apps/SocialQueryDemo.svelte b/ng-app/src/apps/SocialQueryDemo.svelte
index 5c32d8a..524ceec 100644
--- a/ng-app/src/apps/SocialQueryDemo.svelte
+++ b/ng-app/src/apps/SocialQueryDemo.svelte
@@ -13,6 +13,7 @@
import { onMount, tick, onDestroy } from "svelte";
import {
sparql_update,
+ sparql_query,
toast_error,
toast_success,
active_session,
@@ -37,17 +38,79 @@
return definer(hljs);
},
};
-
+
+const ranking_query = `SELECT ?mail (SAMPLE(?n) as?name) (MAX(?rust_) as ?rust) (MAX(?svelte_) as ?svelte) (MAX(?tailwind_) as ?tailwind) (MAX(?rdf_) as ?rdf) (MAX(?yjs_) as ?yjs) (MAX(?automerge_) as ?automerge) (SUM(?total_) as ?total) WHERE {
+ {SELECT ?mail (SAMPLE(?name) as ?n) ?skill (AVG(?value)+1 AS ?score) WHERE {
+ ?rating
?mail.
+ ?rating ?name.
+ ?rating ?hasrating.
+ ?hasrating ?value.
+ ?hasrating ?skill.
+} GROUP BY ?mail ?skill }
+ BIND (IF(sameTerm(?skill, ), ?score, 0) AS ?rust_)
+ BIND (IF(sameTerm(?skill, ), ?score, 0) AS ?svelte_)
+ BIND (IF(sameTerm(?skill, ), ?score, 0) AS ?tailwind_)
+ BIND (IF(sameTerm(?skill, ), ?score, 0) AS ?rdf_)
+ BIND (IF(sameTerm(?skill, ), ?score, 0) AS ?yjs_)
+ BIND (IF(sameTerm(?skill, ), ?score, 0) AS ?automerge_)
+ BIND (?tailwind_+?svelte_+?rust_+?rdf_+?yjs_+?automerge_ AS ?total_)
+} GROUP BY ?mail
+ORDER BY DESC(?total)`;
+
export let commits = {graph:[]};
let source = "";
$: source = commits.graph.join(" .\r\n") + (commits.graph.length ? " .":"");
+ let results = [];
+
+ $: if (commits.graph.length > 4) {
+ sparql_query(ranking_query, false).then((res) => {
+ console.log(res.results?.bindings);
+ results = res.results?.bindings;
+ });
+ }
+
+ const query = `PREFIX vcard:
+PREFIX xskills:
+PREFIX ksp:
+PREFIX ng:
+CONSTRUCT { [
+ vcard:hasEmail ?email;
+ vcard:fn ?name;
+ a vcard:Individual;
+ ng:site ?public_profile;
+ ng:protected ?protected_profile;
+ xskills:hasRating [
+ a xskills:Rating ;
+ xskills:rated ?level;
+ xskills:skill ?skill
+ ]
+ ]
+}
+WHERE {
+ ?contact a vcard:Individual.
+ ?contact vcard:fn ?name.
+ ?contact vcard:hasEmail ?email.
+ OPTIONAL { ?contact ng:site ?public_profile . ?contact ng:site_inbox ?public_inbox }
+ OPTIONAL { ?contact ng:protected ?protected_profile . ?contact ng:protected_inbox ?prot_inbox }
+ ?contact xskills:hasRating [
+ a xskills:Rating ;
+ xskills:rated ?level;
+ xskills:skill ?skill
+ ].
+ ?contact xskills:hasRating/xskills:skill ksp:rust.
+ ?contact xskills:hasRating/xskills:skill ksp:svelte.
+ FILTER ( ?skill IN (
+ ksp:rust, ksp:svelte, ksp:rdf, ksp:tailwind, ksp:yjs, ksp:automerge
+ ) )
+}`;
+
const openQuery = async () => {
//TODO : return now if already processing (when LDO for svelte is ready)
// and even disable the button in that case
try {
- await sparql_update("INSERT DATA { <> \"CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }\".}");
+ await sparql_update(`INSERT DATA { <> \"${query.replaceAll("\n"," ")}\".}`);
let commit_id = commits.heads[0];
let commit_key = commits.head_keys[0];
let session = $active_session;
@@ -66,25 +129,14 @@
}
onMount(()=>{
- console.log($active_session);
+ //console.log($active_session);
});
-
- const info = () => {
- }
-
Social Query
- {#if !source}
-
{$t("doc.no_triples")}
- {/if}
-
+
+ Social Query
+