# ---------------------------------------------------- # Policy Suite for the Financial Scenario # ---------------------------------------------------- PREFIX rdf: PREFIX rdfs: PREFIX swp: PREFIX dc: PREFIX ex: PREFIX wiqa: PREFIX gb: PREFIX vcard: PREFIX foaf: PREFIX xsd: PREFIX exdata: PREFIX fin: PREFIX iso: PREFIX fd: # ---------------------------------------------------- # Policy 01: Information from German analysts # ---------------------------------------------------- NAME "Information from German analysts" DESCRIPTION "Use only information which has been asserted by German analysts." PATTERN { EXPL "it is stated in the document " ?GRAPH ", which is asserted by the German analyst " ?authority "." . GRAPH fd:GraphFromAggregator { ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . } GRAPH fd:BackgroundInformation { ?authority rdf:type fin:Analyst . ?authority fin:country iso:DE . } } # ---------------------------------------------------- # Policy 02: Use only information from information providers # that I have rated positive # ---------------------------------------------------- # # The policy uses the context variable ?USER # For testing, ?USER should be set to the value NAME "Information from positively rated information providers" DESCRIPTION "Use only information from information providers that I have rated positive." PATTERN { EXPL "it is asserted by " ?authority " and you have rated " ?authority " positive." . GRAPH fd:GraphFromAggregator { ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . } GRAPH ?myGraph { ?USER fin:positiveRating ?authority . } GRAPH fd:GraphFromAggregator { ?myGraph swp:assertedBy ?warrant2 . ?warrant2 swp:authority ?USER . } } # ------------------------------------------------------- # Policy 03: New information from highly rated analysts # ------------------------------------------------------- NAME "New information from highly rated analysts" DESCRIPTION "Accept only information that has been asserted after January 1st, 2006 by analysts who achieved a StarMine score above 80" PATTERN { EXPL "it is asserted on " ?date " by the analyst " ?authority " who has a StarMine score of " ?benchmark "." . GRAPH fd:GraphFromAggregator { ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . ?warrant dc:date ?date . FILTER (?date > "2006-01-01T00:00:00"^^xsd:dateTime) . } GRAPH fd:BackgroundInformation { ?authority rdf:type fin:Analyst . ?authority fin:benchmark ?benchmark . FILTER (?benchmark > "80"^^xsd:integer) . } } # ------------------------------------------------------- # Policy 04: Only German or English information # ------------------------------------------------------- NAME "Only German or English information" DESCRIPTION "Accept only German or English information. The language is determined by testing the RDF language tag." PATTERN { EXPL "the text has the RDF language tag DE or EN." . FILTER( lang(?OBJ) = 'DE' || lang(?OBJ) = 'EN' ) } # ------------------------------------------------------- # Policy 05: Accept only information from Deutsche Bank # ------------------------------------------------------- NAME "Accept only information from Deutsche Bank" DESCRIPTION "Checks if information has been asserted by an authority identified with an email address within the domain deutsche-bank.de" PATTERN { GRAPH ANY { EXPL "it is asserted by " ?authority " who has an email address within the domain deutsche-bank.de." . ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . FILTER(regex(str(?authority), 'deutsche-bank.de')) . } } # ------------------------------------------------------- # Policy 06: More positive Ratings # ------------------------------------------------------- NAME "More positive Ratings" DESCRIPTION "Only accept information from information providers who have received more positive than negative ratings." PATTERN { EXPL "The information was asserted by " ?authority " and " wiqa:MorePositiveRatings . GRAPH fd:GraphFromAggregator { ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . FILTER wiqa:MorePositiveRatings(?authority) . } } # ------------------------------------------------------- # Policy 07: TidalTrust rating above 5 # ------------------------------------------------------- # # The policy uses the context variable ?USER # For testing, ?USER should be set to the value NAME "TidalTrust rating above 5" DESCRIPTION "Only accept information from information providers with a Tidial Trust rating above 5." PATTERN { EXPL "it was asserted by " ?authority ". " wiqa:TidalTrust . GRAPH fd:GraphFromAggregator { ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . FILTER (wiqa:TidalTrust(?USER, ?authority) > 5) } } # ------------------------------------------------------- # Policy 08: Asserted by two different analysts # ------------------------------------------------------- NAME "Asserted by two different analysts" DESCRIPTION "Only accept information that has been asserted by at least two different analysts." PATTERN { EXPL "it was asserted by the following analysts:" . GRAPH ANY { ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . } GRAPH ANY { EXPL ?authority . ?authority rdf:type fin:Analyst . } FILTER (wiqa:count(?authority) >= 2) } # ------------------------------------------------------------------ # Policy 09: Asserted by analysts with at least 3 positive ratings # ------------------------------------------------------------------ NAME "Asserted by analysts with at least 3 positive ratings" DESCRIPTION "Only accept information that has been asserted by analysts who have received at least 3 positive ratings." PATTERN { GRAPH fd:GraphFromAggregator { EXPL "it was asserted by " ?authority " and " . ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . } GRAPH ?graph2 { ?authority rdf:type fin:Analyst . } GRAPH fd:GraphFromAggregator { EXPL ?authority2 " claims that " ?authority " is an analyst." . ?graph2 swp:assertedBy ?warrant2 . ?warrant2 swp:authority ?authority2 .} GRAPH ANY { EXPL ?authority " has received positive ratings from " . ?rater fin:positiveRating ?authority . FILTER (wiqa:count(?rater) > 2) . } GRAPH fd:BackgroundInformation { EXPL ?rater " who works for " ?company . ?rater fin:affiliation ?company . } } # ---------------------------------------------------- # Policy 10: Only asserted using the SWP Vocabulary # ---------------------------------------------------- NAME "Only asserted using the SWP Vocabulary" DESCRIPTION "Trust only information that has been explicitly asserted using the SWP Vocabulary." PATTERN { EXPL "it is stated in the document " ?GRAPH ", which is asserted by " ?authority " using the SWP Vocabulary." . GRAPH fd:GraphFromAggregator { ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . } } # ---------------------------------------------------- # Policy 11: Information from UK-based analysts # ---------------------------------------------------- NAME "Information from UK-based analysts" DESCRIPTION "Use only information which has been asserted by analysts located in the United Kingdom." PATTERN { EXPL "it is stated in the document " ?GRAPH ", which is asserted by the analyst " ?authority " who is from the UK." . GRAPH fd:GraphFromAggregator { ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . } GRAPH fd:BackgroundInformation { ?authority rdf:type fin:Analyst . ?authority fin:country iso:UK . } } # ---------------------------------------------------- # Policy 12: Information from Intel employees # ---------------------------------------------------- NAME "Information from Intel employees" DESCRIPTION "Use only information which has been asserted by people who work for Intel." PATTERN { EXPL "it is stated in the document " ?GRAPH ", which is asserted by " ?authority " who works for Intel. " . GRAPH fd:GraphFromAggregator { ?GRAPH swp:assertedBy ?warrant . ?warrant swp:authority ?authority . } GRAPH fd:BackgroundInformation { ?authority fin:affiliation . } }