### Compile WatDiv on UNIX Source: https://dsg.uwaterloo.ca/watdiv Commands to compile WatDiv on a UNIX system. Ensure Boost libraries and a Unix words file are installed. ```bash tar xvf _watdiv_v05.tar_ cd watdiv setenv BOOST_HOME _< BOOST-INSTALLATION-DIRECTORY> _ export BOOST_HOME=_< BOOST-INSTALLATION-DIRECTORY>_ (in bash) make cd _bin/Release_ ``` -------------------------------- ### Example of Scalable Entity Instantiation Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial Illustrates the generated instances for a scalable entity declaration at a specific scale factor (e.g., 20). ```turtle ... ``` -------------------------------- ### Example RDF Dataset for Single PGroup Declaration Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This is an example RDF dataset generated from a schema where 'watdiv:name' and 'watdiv:purchaseDate' are declared within the same PGroup. It shows entities with both properties instantiated. ```turtle "random sequence of words" . "2015-01-01" . "another random sequence of words" . "2015-01-02" . "yet another random sequence of words" . "2015-01-03" . ... "yet yet another random sequence of words" . "2015-01-31" . ``` -------------------------------- ### Example of Non-Scalable Entity Instantiation Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial Illustrates the generated instances for a non-scalable entity declaration. ```turtle ... ``` -------------------------------- ### Type Assertion Example Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial Example RDF triples asserting that specific 'Product' instances are of type 'watdiv:Book'. ```turtle . . ... . . ``` -------------------------------- ### Generated RDF Triples (Default Probability) Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial Example RDF triples generated for 'watdiv:Product' instances when using the default instantiation probability of 1.0. ```turtle "random sequence of words" . "another random sequence of words" . "yet another random sequence of words" . ... "yet yet another random sequence of words" . ``` -------------------------------- ### Example RDF triples generated from a basic property declaration Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This shows a sample of RDF triples generated by WatDiv based on a simple #association declaration. Each triple links a product URI to a retailer URI via the availableAt predicate. ```RDF Turtle . . . ... . ``` -------------------------------- ### Example RDF Dataset for Separate PGroup Declarations Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This RDF dataset illustrates the behavior when properties are in separate PGroups. It shows that 'watdiv:name' and 'watdiv:purchaseDate' are instantiated for different subsets of Product instances. ```turtle "random sequence of words" . "2015-01-01" . "another random sequence of words" . "2015-01-02" . "yet another random sequence of words" . "2015-01-03" . ... "yet yet another random sequence of words" . "2015-01-31" . ``` -------------------------------- ### Generated RDF Triples (Reduced Probability) Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial Example RDF triples generated for 'watdiv:Product' instances when using a reduced instantiation probability of 0.2. ```turtle "random sequence of words" . "another random sequence of words" . "yet another random sequence of words" . ... "yet yet another random sequence of words" . ``` -------------------------------- ### Example RDF triples for a many-to-many relationship Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This dataset illustrates a many-to-many relationship where each product instance is related to multiple retailer instances, as defined by the cardinality parameters. ```RDF Turtle . . . . ... . . . . ``` -------------------------------- ### Generated RDF Triples (Type Restricted) Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial Example RDF triples generated when the PGroupDeclaration is restricted to 'watdiv:Book' instances. Instances not of this type are excluded. ```turtle "random sequence of words" . "another random sequence of words" . "yet another random sequence of words" . ... "yet yet another random sequence of words" . ``` -------------------------------- ### Literal Property Declaration - Use Case 1: Type Only Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This example shows the simplest form of a LiteralPropertyDeclaration, specifying only the property name and its literal type. This is used when no specific value range or distribution is required. ```schema #predicate watdiv:annualIncome integer ``` -------------------------------- ### Generate WatDiv Query Templates (Stress Testing) Source: https://dsg.uwaterloo.ca/watdiv Command to generate more query templates for stress testing. This version includes options for bound patterns and constant join vertices. ```bash ./watdiv -s ``` -------------------------------- ### Generate WatDiv Query Templates with Advanced Options Source: https://dsg.uwaterloo.ca/watdiv Command to generate query templates with advanced options, including the number of bound patterns and whether join vertices can be constants. ```bash ./watdiv -s ``` -------------------------------- ### Generate WatDiv Queries Source: https://dsg.uwaterloo.ca/watdiv Command to run the WatDiv query generator. Use the same model file and query templates from the testsuite directory. ```bash ./watdiv -q ``` -------------------------------- ### SPARQL Query Template S5 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template retrieves descriptions and keywords for entities of a specific product category and language. It uses a placeholder for the product category. ```sparql #mapping v1 wsdbm:ProductCategory uniform SELECT ?v0 ?v2 ?v3 WHERE { ?v0 rdf:type %v1% . ?v0 sorg:description ?v2 . ?v0 sorg:keywords ?v3 . ?v0 sorg:language wsdbm:Language0 . } ``` -------------------------------- ### Declare Namespace Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial Declares a namespace with an identifier and a prefix. This is optional but recommended for schema readability. ```watdiv #namespace watdiv=http://db.uwaterloo.ca/watdiv/ ``` -------------------------------- ### Declare a one-to-one property with instantiation probability Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This declaration sets up a one-to-one relationship where only 10% of subject instances will participate. The InstantiationProbability parameter controls this participation rate. ```WatDiv Schema #association watdiv:Product watdiv:availableAt watdiv:Retailer 1 1 **0.1** ... (For readability, the remaining parameters have been omitted.) ``` -------------------------------- ### Query Review Details Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml Retrieves caption, text, content rating, review titles, reviewers, and associated actors and languages. ```sparql SELECT ?v0 ?v4 ?v6 ?v7 WHERE { ?v0 sorg:caption ?v1 . ?v0 sorg:text ?v2 . ?v0 sorg:contentRating ?v3 . ?v0 rev:hasReview ?v4 . ?v4 rev:title ?v5 . ?v4 rev:reviewer ?v6 . ?v7 sorg:actor ?v6 . ?v7 sorg:language ?v8 . } ``` -------------------------------- ### Query Topic with Homepage and Likes Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml Retrieves topic information including homepage, tags, descriptions, content size, and user likes. ```sparql #mapping v3 wsdbm:Topic uniform SELECT ?v0 ?v1 ?v2 ?v4 ?v5 ?v6 ?v7 ?v8 WHERE { ?v0 foaf:homepage ?v1 . ?v2 gr:includes ?v0 . ?v0 og:tag %v3% . ?v0 sorg:description ?v4 . ?v0 sorg:contentSize ?v8 . ?v1 sorg:url ?v5 . ?v1 wsdbm:hits ?v6 . ?v1 sorg:language wsdbm:Language0 . ?v7 wsdbm:likes ?v0 . } ``` -------------------------------- ### Generate WatDiv Data Source: https://dsg.uwaterloo.ca/watdiv Command to run the WatDiv data generator. This produces RDF triples and a 'saved.txt' file. ```bash ./watdiv -d ``` -------------------------------- ### SPARQL Query Template S3 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template retrieves caption, genre, and publisher for entities of a specific product category. It uses a placeholder for the product category. ```sparql #mapping v1 wsdbm:ProductCategory uniform SELECT ?v0 ?v2 ?v3 ?v4 WHERE { ?v0 rdf:type %v1% . ?v0 sorg:caption ?v2 . ?v0 wsdbm:hasGenre ?v3 . ?v0 sorg:publisher ?v4 . } ``` -------------------------------- ### PGroupDeclaration with Default Instantiation Probability Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This PGroupDeclaration specifies that the 'watdiv:name' property should be generated for all 'watdiv:Product' instances with a default instantiation probability. ```watdiv watdiv:Product 250 1.0 #predicate watdiv:name string ``` -------------------------------- ### Query Retailer Offers Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml Retrieves product information offered by retailers, including price and validity dates. ```sparql #mapping v2 wsdbm:Retailer uniform SELECT ?v0 ?v1 ?v3 ?v4 ?v5 ?v6 WHERE { ?v0 gr:includes ?v1 . %v2% gr:offers ?v0 . ?v0 gr:price ?v3 . ?v0 gr:validThrough ?v4 . ?v1 og:title ?v5 . ?v1 rdf:type ?v6 . } ``` -------------------------------- ### SPARQL Query Template L1 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template retrieves websites subscribed to by a given entity and their captions. It uses a placeholder for the subscriber entity. ```sparql #mapping v1 wsdbm:Website uniform SELECT ?v0 ?v2 ?v3 WHERE { ?v0 wsdbm:subscribes %v1% . ?v2 sorg:caption ?v3 . ?v0 wsdbm:likes ?v2 . } ``` -------------------------------- ### Query Purchase Information by SubGenre Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml Retrieves content ratings, sizes, and purchase details linked to a specific subgenre. ```sparql #mapping v3 wsdbm:SubGenre uniform SELECT ?v0 ?v1 ?v2 ?v4 ?v5 ?v6 WHERE { ?v0 sorg:contentRating ?v1 . ?v0 sorg:contentSize ?v2 . ?v0 wsdbm:hasGenre %v3% . ?v4 wsdbm:makesPurchase ?v5 . ?v5 wsdbm:purchaseDate ?v6 . ?v5 wsdbm:purchaseFor ?v0 . } ``` -------------------------------- ### Query Topic Information Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml Retrieves topic details including tags, types, and related product category information. ```sparql #mapping v1 wsdbm:Topic uniform SELECT ?v0 ?v2 ?v3 ?v4 ?v5 WHERE { ?v0 og:tag %v1% . ?v0 rdf:type ?v2 . ?v3 sorg:trailer ?v4 . ?v3 sorg:keywords ?v5 . ?v3 wsdbm:hasGenre ?v0 . ?v3 rdf:type wsdbm:ProductCategory2 . } ``` -------------------------------- ### PGroupDeclaration with Reduced Instantiation Probability Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This PGroupDeclaration reduces the instantiation probability for 'watdiv:name' to 0.2, meaning only about 20% of 'watdiv:Product' instances will have this property. ```watdiv watdiv:Product 250 **0.2** #predicate watdiv:name string ``` -------------------------------- ### SPARQL Query Template L3 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template retrieves entities that like a given website and are subscribed to by that website. It uses a placeholder for the website. ```sparql #mapping v2 wsdbm:Website uniform SELECT ?v0 ?v1 WHERE { ?v0 wsdbm:likes ?v1 . ?v0 wsdbm:subscribes %v2% . } ``` -------------------------------- ### Query SubGenre Details Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml Retrieves detailed information about subgenres, including homepage, titles, descriptions, and associated URLs and hits. ```sparql #mapping v8 wsdbm:SubGenre uniform SELECT ?v0 ?v1 ?v2 ?v4 ?v5 ?v6 ?v7 WHERE { ?v0 foaf:homepage ?v1 . ?v0 og:title ?v2 . ?v0 rdf:type ?v3 . ?v0 sorg:caption ?v4 . ?v0 sorg:description ?v5 . ?v1 sorg:url ?v6 . ?v1 wsdbm:hits ?v7 . ?v0 wsdbm:hasGenre %v8% . } ``` -------------------------------- ### SPARQL Query Template S1 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template retrieves detailed information about products offered by a specific retailer, including price, serial number, and validity periods. It uses a placeholder for the retailer. ```sparql #mapping v2 wsdbm:Retailer uniform SELECT ?v0 ?v1 ?v3 ?v4 ?v5 ?v6 ?v7 ?v8 ?v9 WHERE { ?v0 gr:includes ?v1 . %v2% gr:offers ?v0 . ?v0 gr:price ?v3 . ?v0 gr:serialNumber ?v4 . ?v0 gr:validFrom ?v5 . ?v0 gr:validThrough ?v6 . ?v0 sorg:eligibleQuantity ?v7 . ?v0 sorg:eligibleRegion ?v8 . ?v0 sorg:priceValidUntil ?v9 . } ``` -------------------------------- ### SPARQL Query Template L2 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template finds countries a given city belongs to and entities that like a specific product and are of that nationality. It uses a placeholder for the city. ```sparql #mapping v0 wsdbm:City uniform SELECT ?v1 ?v2 WHERE { %v0% gn:parentCountry ?v1 . ?v2 wsdbm:likes wsdbm:Product0 . ?v2 sorg:nationality ?v1 . } ``` -------------------------------- ### Declaring Properties in Separate PGroups Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This snippet shows 'watdiv:name' and 'watdiv:purchaseDate' declared in separate PGroupDeclarations. This results in independent instantiation of these properties across different entity instances. ```schema watdiv:Product 250 0.2 #predicate watdiv:name string 0.2 #predicate watdiv:purchaseDate date ``` -------------------------------- ### SPARQL Query Template L4 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template retrieves entities tagged with a specific topic and their captions. It uses a placeholder for the topic. ```sparql #mapping v1 wsdbm:Topic uniform SELECT ?v0 ?v2 WHERE { ?v0 og:tag %v1% . ?v0 sorg:caption ?v2 . } ``` -------------------------------- ### Select Variables with Joins Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This query selects specific variables (?v0, ?v3, ?v4, ?v8) by joining data through various properties like sorg:legalName, gr:offers, and rev:hasReview. It demonstrates how to link entities and their attributes in a knowledge graph. ```SPARQL SELECT ?v0 ?v3 ?v4 ?v8 WHERE { ?v0 sorg:legalName ?v1 . ?v0 gr:offers ?v2 . ?v2 sorg:eligibleRegion wsdbm:Country5 . ?v2 gr:includes ?v3 . ?v4 sorg:jobTitle ?v5 . ?v4 foaf:homepage ?v6 . ?v4 wsdbm:makesPurchase ?v7 . ?v7 wsdbm:purchaseFor ?v3 . ?v3 rev:hasReview ?v8 . ?v8 rev:totalVotes ?v9 . } ``` -------------------------------- ### Declare Scalable Entity Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial Declares a scalable entity with a count per scale factor. The total number of instances increases proportionally with the scale factor. ```watdiv watdiv:Product 250 ... ``` -------------------------------- ### Select Variables with Multiple Conditions Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This query selects a single variable (?v0) based on multiple conditions, including wsdbm:likes, wsdbm:friendOf, dc:Location, foaf:age, wsdbm:gender, and foaf:givenName. It showcases how to retrieve entities that satisfy several criteria simultaneously. ```SPARQL SELECT ?v0 WHERE { ?v0 wsdbm:likes ?v1 . ?v0 wsdbm:friendOf ?v2 . ?v0 dc:Location ?v3 . ?v0 foaf:age ?v4 . ?v0 wsdbm:gender ?v5 . ?v0 foaf:givenName ?v6 . } ``` -------------------------------- ### SPARQL Query Template L5 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template finds job titles and countries for entities that are of a certain nationality within a given country. It uses a placeholder for the country. ```sparql #mapping v2 wsdbm:City uniform SELECT ?v0 ?v1 ?v3 WHERE { ?v0 sorg:jobTitle ?v1 . %v2% gn:parentCountry ?v3 . ?v0 sorg:nationality ?v3 . } ``` -------------------------------- ### SPARQL Query Template S6 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template retrieves conductors and types for entities associated with a specific subgenre. It uses a placeholder for the subgenre. ```sparql #mapping v3 wsdbm:SubGenre uniform SELECT ?v0 ?v1 ?v2 WHERE { ?v0 mo:conductor ?v1 . ?v0 rdf:type ?v2 . ?v0 wsdbm:hasGenre %v3% . } ``` -------------------------------- ### SPARQL Query Template S4 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template retrieves family names and artist information for entities with a specific age group and nationality. It uses a placeholder for the age group. ```sparql #mapping v1 wsdbm:AgeGroup uniform SELECT ?v0 ?v2 ?v3 WHERE { ?v0 foaf:age %v1% . ?v0 oaf:familyName ?v2 . ?v3 mo:artist ?v0 . ?v0 sorg:nationality wsdbm:Country1 . } ``` -------------------------------- ### Declaring Multiple Properties in a Single PGroup Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This snippet demonstrates declaring multiple literal properties (name and purchaseDate) within a single PGroupDeclaration. All properties within the same PGroup are instantiated together for a given entity instance. ```schema watdiv:Product 250 0.2 #predicate watdiv:name string #predicate watdiv:purchaseDate date ``` -------------------------------- ### SPARQL Query Template S2 Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml This template retrieves location, nationality, and gender for entities of a specific type and nationality. It uses a placeholder for the nationality. ```sparql #mapping v2 wsdbm:Country uniform SELECT ?v0 ?v1 ?v3 WHERE { ?v0 dc:Location ?v1 . ?v0 sorg:nationality %v2% . ?v0 wsdbm:gender ?v3 . ?v0 rdf:type wsdbm:Role2 . } ``` -------------------------------- ### Query User Likes Source: https://dsg.uwaterloo.ca/watdiv/basic-testing.shtml Retrieves user information, their type, and associated text, filtered by users liked by a specific entity. ```sparql #mapping v3 wsdbm:User uniform SELECT ?v0 ?v1 ?v2 WHERE { ?v0 rdf:type ?v1 . ?v0 sorg:text ?v2 . %v3% wsdbm:likes ?v0 . } ``` -------------------------------- ### Declare a basic non-literal property association Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This declaration dictates the generation of RDF triples where instances of two entities are related by an RDF predicate. It specifies the subject entity, predicate, and object entity. ```WatDiv Schema #association watdiv:Product watdiv:availableAt watdiv:Retailer ... (For readability, only the first three parameters are shown.) ``` -------------------------------- ### Declare a many-to-many property with cardinality Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This declaration specifies a many-to-many relationship where each subject instance can be related to 1 to 5 object instances. SubjectCardinality is 2 and ObjectCardinality is 5. ```WatDiv Schema #association watdiv:Product watdiv:availableAt watdiv:Retailer 2 5 ... (For readability, the remaining parameters have been omitted.) ``` -------------------------------- ### Declare Non-Scalable Entity Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial Declares a non-scalable entity with a specific count. The number of instances is fixed regardless of the scale factor. ```watdiv watdiv:Genre 20 ... ``` -------------------------------- ### PGroupDeclaration with Type Restriction Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This PGroupDeclaration restricts the generation of the 'watdiv:name' property to 'watdiv:Product' instances that are also of type 'watdiv:Book'. ```watdiv watdiv:Product 250 1.0 @**watdiv:Book** #predicate watdiv:name string ``` -------------------------------- ### Literal Property Declaration - Use Case 3: Type, Value Range, and Distribution Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This is the most detailed LiteralPropertyDeclaration, specifying the property name, literal type, a value range, and a distribution type (e.g., 'normal'). This allows for more controlled and realistic data generation. ```schema #predicate watdiv:annualIncome integer 11000 100000 normal ``` -------------------------------- ### Literal Property Declaration - Use Case 2: Type and Value Range Source: https://dsg.uwaterloo.ca/watdiv/watdiv-schema-tutorial This declaration includes a property name, literal type, and a range defined by two literal values. This is used to constrain the generated values within a specified minimum and maximum. ```schema #predicate watdiv:annualIncome integer 11000 100000 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.