Your SlideShare is downloading. ×
Semantic Modeling - A Query Language for the 21st century
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Semantic Modeling - A Query Language for the 21st century

889

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
889
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Semantic
Modeling A
query
language
for
the
21st
century Clifford
Heath
  • 2. Semantics • The
shared
meanings
of
a
community • Expressed
in
facts Here,
a
model
is: • Standard
for
comparison • Simplified
representation
of
 the
real
world • NOT
a
prototype
or
mockup
  • 3. Communicate! Models must be expressed in a way that allows all parties to understand and contribute to them Flickr, mknowles
  • 4. ActiveFacts
project A project of Data Constellation • Constellation
Query
Language • Constellation
API • GUI
design
tools
  • 5. Elementary
Facts
are
simple e.g.
This
person
is
called
‘John’
  • 6. The
elementary
form must
be
our
code • Models
must
be
executable • Tools
must
handle
the
ramifications
  • 7. ActiveFacts
Generators • CQL
or
ORM2
input • Ruby,
SQL
output • Later,
C#,
Java,
etc,
or
write
your
own All code you will see in this part is as generated
  • 8. ORM2
Example This and all other ORM2 examples were created using NORMA, the Neumont ORM2 Architect
  • 9. CQL
and
ORM2 side
by
side
  • 10. Value
Types ORM2: Each
statement
creates
or
implies
two
ValueTypes
  • 11. Entity
Types ORM2: CQL: = Custom reading:
  • 12. Fact
Types ORM2: CQL:
  • 13. One­to­one or
more
accurately:
  • 14. Objectified
Fact
Types ORM2: CQL: and
then
we
can:
  • 15. Ternary
and
higher subset:
  • 16. Composite
Identification ORM2: CQL: ... Two Fact Types, each with 2 readings!
  • 17. Subtypes,
etc (non-identifying supertype) ORM2: CQL: also: unary fact type, ring constraint, XOR constraint
  • 18. Fact
Instances Value
Type: Entity
Type: Composite: ...
note
the
join
over
Person Join
Contraction: ...
the
contracted
form
isn’t
implemented
yet!
  • 19. Subset
constraints
  • 20. Mandatory
/
Exclusive Mandatory
and
exclusive Also
mandatory
non­exclusive, Exclusive
non­mandatory
  • 21. Equivalence
  • 22. Join
constraints “Product”
is
the
same
instance
in
both
clauses
  • 23. Code
Generation
  • 24. From 
ORM
to
CQL
  • 25. Mapping
From
Facts
to
ER ...Halpin • Identifiers
define
keys • Decide
absorption using uniqueness • Composition
­
makes
composite
fact
types • Other
constraints
can
be
enforced
too
  • 26. SQL
Composition
  • 27. Generated
SQL
­
today • Tables • Columns • Primary
keys
/
Unique
constraints • Foreign
Key
constraints
  • 28. Generated
SQL
­
coming • CHECK
constraints • Indexes
over
views
where
needed • Triggers
if
nec. • Automatic
Migration • even
delayed
migration
  • 29. Generated
Ruby
  • 30. Ruby
API • Uses
meta
programming • Relationships
create
both
methods • Implements
multiple
inheritance • Excludes
Readings
(for
now)
  • 31. No
need
to
 generate
the
code • Simply
‘require’
the
CQL • ActiveFacts
generates
and
eval’s
Ruby • Open
classes
allow
you
to
extend
them • No
need
to
edit
generated
code
  • 32. API
Documentation • Every
Role
has
a
method • ORM2
diagram
is
API
documentation • Could
also
generate
documentation
  • 33. <DogFood>
  • 34. ActiveFacts uses its generated Ruby metamodel code
  • 35. Programming and Persistence
  • 36. Constellation
API • Constellation
is
a
population
of
 fact
instances
over
a
vocabulary
  • 37. Constellation
API • A
Vocabulary
is
a
Ruby
module • Every
concept
is
a
class • Every
instance
is
of
a
concept 

(no
raw
values) • No
duplicate
instances • Fully
cross­referenced • No
new()
­
just
assert
/
deny
  • 38. Persistence
 (not
implemented
yet) • One
query
for
each
user
action • Each
query
yields
a
constellation • Assert/deny
any
facts,
then • One
save() • Constraint
enforcement • Changes
get
saved
transactionally
  • 39. Queries (work
in
progress)
  • 40. Simple
Query Person
has
given­Name
‘Daniel’?
  • 41. Deriving
Fact
Types family­Name
controls
Company
: Person
directs
Company, Person
has
family
Name; family
Name
controls
Company
‘Acme,
Inc’? family
Name
controls
Company? family
Name
‘Heath’
controls
Company?
  • 42. Query
nesting • A
query
can
invoke
derived
fact
types • Sub­queries
return
distinct
instances (handles
SQL’s
DISTINCT

and
GROUP
BY) • Aggregation
functions
as
per
SQL • Goal:
more
power
than
SQL
SELECT
  • 43. “returning” family
Name
controls
Company
: Person
directs
Company, Person
has
family
Name, returning
Person, by
Company; • “returning”
makes
Person.given_name
available • “returning
by”
applies
sorting • Inner
join
semantics
apply
if
family
Name
is
unknown
  • 44. “returning”
is
transitive normal
stuff
for
Person: maybe
Person
was
born
on
birth
Date, maybe
Person
is
Employee, Employee
has
EmployeeNr, returning
birth
Date,
EmployeeNr; Person
is
called
family­Name
‘Smith’, normal
stuff
for
Person?
  • 45. Transitive
queries Employee
works
under
Manager
: Employee
is
supervised
by
Manager
[transitive]; Employee
works
under
Manager
473?
  • 46. either/or family
Name
is
associated
with
Company
: Person
(as
Director)
directs
Company
or Person
works
at
Company, Person
has
family
Name;
  • 47. Units Pane
has
Area: Pane
of
glass
has
Width, Pane
of
glass
has
Height, Width
*
Height
=
Area; large
Pane: Pane
has
Area,
Area
>=
5
foot^2; large
Pane? Width
and
Height
may
be
stored
in
millimetres!
  • 48. Date
and
Time Person
is
adult: Person
was
born
on
birth
Date, birth
Date
<
Now
­
18
years, returning
birth
Date; future:
“Person
was
born
on
birth
Date
before
18
years
ago”
  • 49. Future
work • API
Persistence
and
DBMS
adapters • Queries,
including
drag­drop
GUI • Units
support • Other
languages
(natural
and
computer) • APRIMO,
a
web­hosted
semantic
designer • Reverse
engineering • Automatic
migration
  • 50. Demonstrations and
Questions
  • 51. Clifford
Heath Available
for
consulting
and
training http://dataconstellation.com/

×