33
© Copyright 2009 TopQuadrant Inc. Slide TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

Embed Size (px)

Citation preview

Page 1: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 1

TopQuadrant

Metrics and QA Support

TopBraid Suite

Supporting the Complete Semantic Application Lifecycle

Page 2: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 2

Metrics Agenda

Kinds of Metrics Approach to Metrics Model Metrics Class Metrics Property Metrics Other QA Support Conclusion

Page 3: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 3

CouplingComplianceComplexityCorrectness

CohesionConsistency

Kinds of Metrics

Models

Classes

Properties

Axioms

of

Page 4: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 4

Models and Namespaces:NASA Ontologies

EnterpriseInformationTechnology

Structure,Electrical, Hydraulic, Thermal, …

LifecycleSocial

CompetenciesCritical SkillsHuman

Organizational Risks

Page 5: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 5

NIEM OWL Ontologies

NIEM XSD Schemas

Translation of NIEM XML Schemas to OWL

Import into TopBraid Composer

Page 6: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 6

NIEM Person (Proto) OWL Model

To address reusability, the NIEM Person was re-factored into individual ‘Details’ classes.

Page 7: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 7

Metrics on the NIEM OWL Model

SELECT ?class ?restrictionCountWHERE { ?class a owl:Class . LET ( ?restrictionCount := smf:countResults( "SELECT DISTINCT ?property WHERE { ?class rdfs:subClassOf ?restriction . ?restriction a owl:Restriction . ?restriction owl:onProperty ?property }" )) }

Page 8: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 8

Refactoring of NIEM Person into an OWL Model with reusable Concepts (person:Details)

Depending on the context of use, concepts describing different details about a person can be selected

Page 9: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 9

Approach to Metrics

User-Definable Extensible Flexible Reporting Model-Based Rule-Based

Page 10: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 10

Model Metrics - 1

Namespaces versus Named Graphs Model-Based Rule-Based Flexible Reporting

Page 11: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 11

NASA CxDA:Importance of Data Architecture

CxP 70160 ANX10Infrastructure Specification

CxP 70160 ANX11Application Programming

Interface Specification

CxP 70160 ANX14 Policy and Security

Model

Page 12: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 12

Model Metrics - 2

Class Metrics for Number of:– Classes (NoC)– Leaf Classes (NoLC)– Root Classes (NoRC)– Superclasses (NoSpC)– Subclasses (NoSbC)– Classes with Equivalent Class Expressions (NoEqC)– Classes with ‘HasValue’ restriction Axioms (NoHvR)– Average Depth of Inheritance (AvDoI)– Max Depth of Inheritance (MxDoI)

Page 13: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 13

Metrics for Individual Models

OARS - Ontology Architecture Requirements Specification Ontology

UC - Use Case Ontology

Page 14: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 14

Model Metrics - 3

Property Metrics for Number of:– Datatype Properties (NoDtP)– Object Properties (NoOP)– Annotation Properties (NoAP)

Ratio Metrics for– Specialization Ratio (=NoSbC/NoSpC)– Reuse Ratio (=NoSbC/NoC)

Page 15: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 15

Model Metrics Examples - 1

A

D E F G

C

H I

Metric Value

NoC 9

NoRC 3

NoLC 4

NoSpC 4

NoSbC 6

RaSp 1.50

RaRu 0.67

B

Page 16: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 16

TopBraid Metrics Approach is Model-Based

SPIN Construct Rules are used to generate Metric Triples for the Metrics Model – an ontology called ‘oqa.owl’

Page 17: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 17

TopBraid OQA:Namespace Metrics

‘oqa:NamespaceMetricRow’ holds metrics for a given namespace

Page 18: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 18

TopBraid Metrics Approach is Model-Based

SPIN Construct Rules are used to generate Metric Triples for the Metrics Model – an ontology called ‘oqa.owl’

Page 19: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 19

SPIN Functions enable Reusable Model Rules

SPIN Construct Rules are used to generate Metric Triples for the Metrics Model – an ontology called ‘oqa.owl’

Page 20: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 20

Class Metrics

Property Metrics for Number of:– Datatype Properties (NoDtP)– Object Properties (NoOP)– Annotation Properties (NoAP)

Axiom Metrics for Number of:– Equivalent Class– Has Value Restrictions

Page 21: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 21

TopBraid Class Metrics

SPIN Construct Rules are used to generate Metric Triples for the Metrics Model – an ontology called ‘oqa.owl’

Page 22: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 22

SPARQLMotion Script for Metrics Generation

Import the OARS Ontology to run metrics over it.

Run the SPIN Engine

Import System ontology

Get the JSP Script for the report

Run the JSP Script

Export the HTML Report

Page 23: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 23

Class Metrics Example: OARSOntology Architecture Requirements Specification

Page 24: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 24

JSP Metrics Report Sample<body><h2>Ontology Models Report</h2><table class="metricTable" width="800" align="center"><tr><td class="cellHead">NoC</td><td class="cellHead">NoEqC</td><td class="cellHead">NoHvR</td><td class="cellHead">NoDtP</td><td class="cellHead">NoOP</td><td class="cellHead">NoAP</td><td class="cellHead">NoRC</td><td class="cellHead">NoLC</td><td class="cellHead">NoSbC</td><td class="cellHead">NoSpC</td><td class="cellHead">RaSp</td></tr> <sparql:select var="mReport">

SELECT *WHERE { ?report a oqa:ModelMetricsReport . OPTIONAL {?report oqa:classes ?classes } . OPTIONAL {?report oqa:annotationProperties ?aprops } . OPTIONAL {?report oqa:objectProperties ?oprops } . OPTIONAL {?report oqa:datatypeProperties ?dprops } . OPTIONAL {?report oqa:rootclasses ?rootclasses } . OPTIONAL {?report oqa:leafclasses ?leafclasses } . OPTIONAL {?report oqa:subclasses ?subclasses } . OPTIONAL {?report oqa:superclasses ?superclasses } . OPTIONAL {?report oqa:specializationRatio ?ratioraw . LET (?decimal := smf:indexOf(?ratioraw, ".")) . LET (?ratio := smf:subString(?ratioraw, 0, (?decimal+4)))} . OPTIONAL {?report oqa:classesWithEquivalentClassExpressions ?equivClass} . OPTIONAL {?report oqa:classesWithHasValueRestrictions ?clsHasValue } .}

</sparql:select><c:forEach items="${mReport.rows}" var="modelRow"><tr>

<td class="cell"><sparql:out node="${modelRow.classes}" /></td><td class="cell"><sparql:out node="${modelRow.equivClass}" /></td><td class="cell"><sparql:out node="${modelRow.clsHasValue}" /></td><td class="cell"><sparql:out node="${modelRow.dprops}" /></td><td class="cell"><sparql:out node="${modelRow.oprops}" /></td><td class="cell"><sparql:out node="${modelRow.aprops}" /></td><td class="cell"><sparql:out node="${modelRow.rootclasses}" /></td><td class="cell"><sparql:out node="${modelRow.leafclasses}" /></td><td class="cell"><sparql:out node="${modelRow.subclasses}" /></td><td class="cell"><sparql:out node="${modelRow.superclasses}" /></td><td class="cell"><sparql:out node="${modelRow.ratio}" /></td>

</tr></c:forEach>

</table>

Embedded SPARQL query

Embedded SPARQL query

Page 25: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 25

Property Metrics

Semantic Weight– Occurrences of properties on Classes

Page 26: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 26

Other QA Capabilities

Model Integrity Missing Constructs Model Dependencies Differences across Versions

Page 27: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 27

Demos

Page 28: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 28

Thank You

Ralph Hodgson E-mail: [email protected]

Page 29: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 29

Backup

Page 30: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 30

Refactoring of NIEM Person into a Model with reusable Concepts (person:AppearanceDetails)

A Person’s ‘Appearance Details’ will be needed for criminal investigations.

Page 31: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 31

Refactoring of NIEM Person into a Model with reusable Concepts (person:ConditionDetails)

A Person’s ‘Condition Details’ will be needed for both driving incidents and criminal investigations.

Page 32: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 32

Refactoring of NIEM Person into a Model with reusable Concepts (person:SocialDetails)

A Person’s ‘Social Details’ will be needed for change of status, such as naturalization.

Page 33: © Copyright 2009 TopQuadrant Inc. Slide 1 TopQuadrant Metrics and QA Support TopBraid Suite Supporting the Complete Semantic Application Lifecycle

© Copyright 2009 TopQuadrant Inc. Slide 33

Refactoring of NIEM Driving Incident into a Model showing reusable Concepts

The NIEM Driving Incident concept is also being re-factored. The use of ‘Augmentation’ classes simplifies the construction of UBL documents.