Implementation
Implementation
Find update queries to evaluate
SolidBench
Solibench has a choke point list. The benchmark is based on SNB.
SNB
I found an acid test suite and a presentation about SNB. The presentation contains 2 lists of inserts/ updates and remove operations: BI and interactive, easily discoverable on their docs site. Their choke points can be found in the full docs.
Only a few are relevant to updates:
- CP-9.1: This choke point tests the ability of the database to insert a node.
- CP-9.2: This choke point tests the ability of the database to insert an edge.
- CP-9.3: This choke point tests the ability of the database to delete a node.
- CP-9.4: This choke point tests the ability of the database to delete an edge.
- CP-9.5: This choke point tests the ability of the database to recursively perform a delete operation, e.g. delete an entire message thread.
SNB definitions:
- Query mix:
- The ratio of read and update queries of a workload, and the frequency at which they are issued
Develop benchmarks based on choke points
Implement SGV into SolidBench
We start by hard coding an example sgv config based on a simple example generated by an existing SolidBench config.
{
"comment": "fragment by creation day",
"@type": "QuadTransformerCompositeSequential",
"transformers": [
{
"@type": "QuadTransformerDistinct",
"transformer": {
"@type": "QuadTransformerAppendQuadLink",
"matcher": {
"@type": "QuadMatcherPredicate",
"predicateRegex": "vocabulary/hasCreator$"
},
"identifier": "object",
"predicate": "http://localhost:3000/internal/postsFragmentation",
"link": "http://localhost:3000/internal/FragmentationCreationDate"
}
},
{
"@type": "QuadTransformerRemapResourceIdentifier",
"newIdentifierSeparator": "../posts_tmp#",
"typeRegex": "vocabulary/Post$",
"identifierPredicateRegex": "vocabulary/id$",
"targetPredicateRegex": "vocabulary/hasCreator$"
},
{
"@type": "QuadTransformerRemapResourceIdentifier",
"newIdentifierSeparator": "../posts/",
"typeRegex": "vocabulary/Post$",
"identifierPredicateRegex": "vocabulary/creationDate$",
"targetPredicateRegex": "vocabulary/hasCreator$",
"identifierValueModifier": {
"@type": "ValueModifierRegexReplaceGroup",
"regex": "^([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]).*$"
},
"keepSubjectFragment": true
},
{
"@type": "QuadTransformerDistinct",
"transformer": {
"@type": "QuadTransformerAppendResourceSolidTypeIndex",
"typeRegex": "vocabulary/Post$",
"profilePredicateRegex": "vocabulary/hasCreator$",
"typeIndex": "../settings/publicTypeIndex",
"entrySuffix": "#entry-posts",
"entryReference": "../posts/",
"entryContainer": "true"
}
}
]
}
Essentially, each pod that has a:
</profile/card#me> <http://localhost:3000/internal/FragmentationCreationDate> <http://localhost:3000/internal/FragmentationCreationDate>
Should have a describing sgo resource:
@prefix : <http://localhost:3000/mypod/sgv-description> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.org/> .
@prefix sgv: <https://thesis.jitsedesmet.be/solution/storage-guidance-vocabulary/#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ldbc: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/> .
@prefix dbo: <https://dbpedia.org/ontology> .
:pod a ldp:Container, sgv:unstructured-container ;
sgv:client-control [
a sgv:allow-when-not-claimed ;
] ;
sgv:one-file-one-resource "false"^^xsd:boolean .
# An unstructured container contains a structured container "posts"
:posts-container a ldp:Container, sgv:structured-container .
# And we describe that container...
:posts-container a sgv:canonical-container ;
sgv:save-condition [
a sgv:always-stored ;
] ;
sgv:update-condition [
a sgv:update-prefer-static ;
] ;
sgv:resource-description [
a sgv:shacl-descriptor ;
sgv:shacl-shape ex:postsShape ;
] ;
sgv:materilization [
a sgv:materialize-file ;
sgv:group-strategy [
a sgv:group-strategty-uri-template ;
# automatically preceded with "{base}"
sgv:uri-template
'/{http%3A%2F%2Flocalhost%3A3000%2Fwww.ldbc.eu%2Fldbc_socialnet%2F1.0%2Fvocabulary%2FcreationDate:10}#{http%3A%2F%2Flocalhost%3A3000%2Fwww.ldbc.eu%2Fldbc_socialnet%2F1.0%2Fvocabulary%2Fid}' ;
] ;
] .
ex:postShape
a sh:NodeShape ;
sh:property [
sh:path rdfs:type ;
sh:class ldbc:Post ;
] ;
sh:property [
sh:path ldbc:id ;
sh:datatype xsd:long ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path ldbc:creationDate ;
sh:datatype xsd:dateTime ;
sh:minCount 1 ;
sh:maxCount 1 ;
] .
Implement SGV into Comunica
We start by writing a query like that inserts a Post
prefix ns1: <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/vocabulary/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
INSERT DATA {
<> a ns1:Post ;
ns1:browserUsed "Chrome" ;
ns1:content "I want to eat an apple while scavenging for mushrooms in the forest. The sun will be such a blessing." ;
ns1:creationDate "2012-05-08T23:23:56.830000+00:00"^^xsd:dateTime ;
ns1:hasCreator <http://localhost:3000/pods/00000000000000000096/profile/card#me> ;
ns1:hasTag <http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/Alanis_Morissette>,
<http://localhost:3000/www.ldbc.eu/ldbc_socialnet/1.0/tag/Austria> ;
ns1:id "416608218494388"^^xsd:long ;
ns1:isLocatedIn <http://localhost:3000/dbpedia.org/resource/China> ;
ns1:locationIP "1.83.28.23" ;
}
Run implementation in SolidBench
We can use jbr. An example can be found in the link traversal experiment repo.