Identifying Security Issues in the Semantic Web: Injection attacks in the Semantic Query Languages
Semantic Modeling - A Query Language for the 21st century
-
Upload
clifford-heath -
Category
Technology
-
view
901 -
download
0
Transcript of Semantic Modeling - A Query Language for the 21st century
SemanticModelingAquerylanguageforthe21stcentury
CliffordHeath
Semantics• Thesharedmeaningsofacommunity
• Expressedinfacts
Here,amodelis:• Standardforcomparison
• Simplifiedrepresentationoftherealworld
• NOTaprototypeormockup
Models must be expressed in a way that allows all parties to understand
and contribute to them
Communicate!
Flickr, mknowles
ActiveFactsproject
• ConstellationQueryLanguage
• ConstellationAPI
• GUIdesigntools
A project of Data Constellation
ElementaryFactsaresimple
e.g.Thispersoniscalled‘John’
Theelementaryformmustbeourcode
•Modelsmustbeexecutable
• Toolsmusthandletheramifications
ActiveFactsGenerators
• CQLorORM2input
• Ruby,SQLoutput
• Later,C#,Java,etc,orwriteyourown
All code you will see in this part is as generated
ORM2Example
This and all other ORM2 examples were created using NORMA, the Neumont ORM2 Architect
CQLandORM2sidebyside
ValueTypes
ORM2:
EachstatementcreatesorimpliestwoValueTypes
EntityTypes
ORM2:
CQL:=
Custom reading:
FactTypes
ORM2:
CQL:
Onetoone
ormoreaccurately:
ObjectifiedFactTypes
ORM2:
CQL:
andthenwecan:
Ternaryandhigher
subset:
CompositeIdentificationORM2:
CQL:
... Two Fact Types, each with 2 readings!
Subtypes,etc
ORM2:
CQL:
(non-identifying supertype)
also: unary fact type, ring constraint, XOR constraint
FactInstancesValueType:
EntityType:
Composite:
...notethejoinoverPerson
...thecontractedformisn’timplementedyet!
JoinContraction:
Subsetconstraints
Mandatory/Exclusive
Mandatoryandexclusive
Alsomandatorynonexclusive,Exclusivenonmandatory
Equivalence
Joinconstraints
“Product”isthesameinstanceinbothclauses
CodeGeneration
FromORMtoCQL
MappingFromFactstoER
• Identifiersdefinekeys
• Decideabsorption using uniqueness
• Compositionmakescompositefacttypes
• Otherconstraintscanbeenforcedtoo
...Halpin
SQLComposition
GeneratedSQLtoday
• Tables
• Columns
• Primarykeys/Uniqueconstraints
• ForeignKeyconstraints
GeneratedSQLcoming
•CHECKconstraints
• Indexesoverviewswhereneeded
• Triggersifnec.
• AutomaticMigration
• evendelayedmigration
GeneratedRuby
RubyAPI
•Usesmetaprogramming
• Relationshipscreatebothmethods
• Implementsmultipleinheritance
• ExcludesReadings(fornow)
Noneedtogeneratethecode
•Simply‘require’theCQL
• ActiveFactsgeneratesandeval’sRuby
•Openclassesallowyoutoextendthem
•Noneedtoeditgeneratedcode
APIDocumentation
• EveryRolehasamethod
•ORM2diagramisAPIdocumentation
• Couldalsogeneratedocumentation
<DogFood>
ActiveFacts uses its generated Ruby metamodel code
Programmingand
Persistence
ConstellationAPI
• Constellationisapopulationoffactinstancesoveravocabulary
ConstellationAPI
•AVocabularyisaRubymodule
• Everyconceptisaclass
• Everyinstanceisofaconcept(norawvalues)
• Noduplicateinstances
• Fullycrossreferenced
• Nonew()justassert/deny
•Onequeryforeachuseraction
• Eachqueryyieldsaconstellation
• Assert/denyanyfacts,then
•Onesave()
• Constraintenforcement
• Changesgetsavedtransactionally
Persistence(notimplementedyet)
Queries(workinprogress)
SimpleQuery
PersonhasgivenName‘Daniel’?
DerivingFactTypes
familyNamecontrolsCompany:PersondirectsCompany,PersonhasfamilyName;
familyNamecontrolsCompany‘Acme,Inc’?familyNamecontrolsCompany?familyName‘Heath’controlsCompany?
Querynesting
• Aquerycaninvokederivedfacttypes
• Subqueriesreturndistinctinstances(handlesSQL’sDISTINCTandGROUPBY)
• AggregationfunctionsasperSQL
• Goal:morepowerthanSQLSELECT
“returning”
familyNamecontrolsCompany:PersondirectsCompany,PersonhasfamilyName,returningPerson,byCompany;
• “returning”makesPerson.given_nameavailable• “returningby”appliessorting• InnerjoinsemanticsapplyiffamilyNameisunknown
“returning”istransitive
normalstuffforPerson:maybePersonwasbornonbirthDate,maybePersonisEmployee,EmployeehasEmployeeNr,returningbirthDate,EmployeeNr;
PersoniscalledfamilyName‘Smith’,normalstuffforPerson?
Transitivequeries
EmployeeworksunderManager:EmployeeissupervisedbyManager[transitive];
EmployeeworksunderManager473?
either/or
familyNameisassociatedwithCompany:Person(asDirector)directsCompanyorPersonworksatCompany,
PersonhasfamilyName;
Units
largePane:PanehasArea,Area>=5foot^2;
WidthandHeightmaybestoredinmillimetres!
PanehasArea:PaneofglasshasWidth,PaneofglasshasHeight,Width*Height=Area;
largePane?
DateandTime
Personisadult:PersonwasbornonbirthDate,birthDate<Now18years,returningbirthDate;
future:“PersonwasbornonbirthDatebefore18yearsago”
Futurework
• APIPersistenceandDBMSadapters
• Queries,includingdragdropGUI
• Unitssupport
• Otherlanguages(naturalandcomputer)
• APRIMO,awebhostedsemanticdesigner
• Reverseengineering
• Automaticmigration
DemonstrationsandQuestions
CliffordHeathAvailableforconsultingandtraining
http://dataconstellation.com/