{"id":61,"date":"2007-09-16T09:52:25","date_gmt":"2007-09-16T16:52:25","guid":{"rendered":"http:\/\/www.juliasshaw.com\/blog\/?p=61"},"modified":"2007-09-16T09:52:25","modified_gmt":"2007-09-16T16:52:25","slug":"teaser-breaking-the-build-in-panopticode-02","status":"publish","type":"post","link":"http:\/\/www.juliasshaw.com\/blog\/2007\/09\/16\/teaser-breaking-the-build-in-panopticode-02\/","title":{"rendered":"Teaser: Breaking the Build in Panopticode 0.2"},"content":{"rendered":"<div class=\"post_details\">\n<div class=\"post_body\">\n<p>In the\u00a0<a href=\"http:\/\/www.juliasshaw.com\/blog\/2007\/09\/12\/teaser-creating-ad-hoc-reports-in-panopticode-02\/\" target=\"_blank\">last post<\/a>\u00a0we learned that Panopticode 0.2 will allow us to create arbitrary reports using a SPARQL SELECT query. Another feature in Panopticode 0.2 is to use a SPARQL ASK query to break the build.<\/p>\n<p>An ASK query looks very similar to a SELECT but without any elements to return. If the query matches any data it returns true, otherwise it returns false.<\/p>\n<p>Rewriting last post\u2019s SELECT query as an ASK query would look like:<\/p>\n<pre><code> PREFIX rdf: &lt;http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#&gt;\n PREFIX panopticode: &lt;http:\/\/www.panopticode.org\/ontologies\/panopticode#&gt;\n PREFIX java: &lt;http:\/\/www.panopticode.org\/ontologies\/technology\/java#&gt;\n PREFIX emma: &lt;http:\/\/www.panopticode.org\/ontologies\/supplement\/emma\/1#&gt;\n PREFIX javancss: &lt;http:\/\/www.panopticode.org\/ontologies\/supplement\/javancss\/1#&gt;\n\n ASK WHERE\n {\n   ?package         rdf:type                       java:Package           .\n   ?package         panopticode:name               ?packageName           .\n   ?package         java:hasFile                   ?file                  .\n   ?file            panopticode:filePath           ?filePath              .\n   ?file            java:hasType                   ?class                 .\n   ?class           panopticode:name               ?className             .\n   ?class           java:hasExecutableMember       ?method                .\n   ?method          java:methodSignature           ?methodSignature       .\n   ?method          emma:hasLineCoverage           ?lineCoverage          .\n   ?method          javancss:cyclomaticComplexity  ?ccn                   .\n   ?lineCoverage    emma:coveredPercent            ?lineCoveragePercent   .\n\n   FILTER (?ccn &gt; 1) .\n   FILTER (?lineCoveragePercent &lt;= 80.0)\n }\n<\/code><\/pre>\n<p>Panopticode 0.2 will come with an Ant task that automatically breaks the build when an ASK query returns true.<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the last post we learned that Panopticode 0.2 will allow us to create arbitrary reports using a SPARQL SELECT query. Another feature in Panopticode 0.2 is to use a SPARQL ASK query to break the build. <a href=\"http:\/\/www.juliasshaw.com\/blog\/2007\/09\/16\/teaser-breaking-the-build-in-panopticode-02\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[17,18,19,25],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-categories-suck-tags-rule","tag-metrics","tag-open-source","tag-panopticode","tag-technology"],"_links":{"self":[{"href":"http:\/\/www.juliasshaw.com\/blog\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.juliasshaw.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.juliasshaw.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.juliasshaw.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.juliasshaw.com\/blog\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":0,"href":"http:\/\/www.juliasshaw.com\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.juliasshaw.com\/blog\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.juliasshaw.com\/blog\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.juliasshaw.com\/blog\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}