P/FDM METADATA CLASSES as Daplex Declarations BASIC METADATA – ENTITY AND PROPERTY TYPES declare objmet ->> entitydeclare oname(objmet) -> string %unique obj idkey_of objmet is oname %% an entity class in Daplex%declare entmet ->> objmetdeclare super(entmet) -> entmet %its supertypedeclare rdfname(entmet) -> string %link to RDF schema %% a property (on an entity class) in Daplex%declare propmet ->> objmetdeclare fname(propmet) -> string %property namedeclare firstargtype(propmet) -> entmet %domaindeclare resulttype(propmet) -> entmet %rangedeclare has_inv(propmet) -> boolean %has an inversedeclare rdfname(propmet) -> string %link to RDF schema METADATA FOR CONSTRAINTS WITH QUANTIFIERSe.g. ("X in Domx) p(X) ® ("Y in Domy) q(X,Y) & r(Y) ® ($Z in Domz) pred(X,Y,Z)
Based on Range-restricted FOLTranslates to RDF/RDFS independent of Colan Syntax%% implies constraint%declare impliesconstr ->> constraint Subtype for "
declare qvar(impliesconstr) -> setmemdeclare if(impliesconstr) -> boolpreddeclare then(impliesconstr) -> constraint (any subtype) %% exists constraint%declare existsconstr ->> constraint Subtype for $
declare qvar(existsconstr) -> setmemdeclare suchthat(existsconstr) -> constraint (any subtype) %% body without quantifiers%declare unquantified_constraint ->> constraint Simplestdeclare body(unquantified_constraint) -> boolpred METADATA for VARIABLES AND SETSe.g. instance: (p in person) %% variable%declare variable ->> singletondeclare varname(variable) -> string %variable name %% varable in set%declare setmem ->> boolprimdeclare var(setmem) -> variable %the variabledeclare set(setmem) -> setexpr %the set %% multivalued function call that generates a set%declare mvfncall ->> setexprdeclare prop(mvfncall) -> propmet %the property that generates the setdeclare arg(mvfncall) -> objmet %the argument
e.g.instance: (age(x) > 3) & (tall(x) || short(x))
{Effectively stores parse tree of constraint,
with tips referencing entity or assocn metadata}
declare boolpred ->> expr %boolean predicatedeclare boolterm ->> boolpred %boolean term declare boolfac ->> boolterm % factor (in a term)declare boolprim ->> boolfac %boolean primitive declare boolor ->> boolpred %boolean ordeclare op(boolor) ->> boolterm %list of or-ed terms declare booland ->> boolterm %boolean anddeclare op(booland) ->> boolfac %list of and-ed factors declare negfac ->> boolfac %signed boolean factor declare negop(negfac) -> string % sign{+,-}declare body(negfac) -> boolprim %negated body %% comparison%declare comparison ->> boolprimdeclare op1(comparison) -> arith_exprdeclare op2(comparison) -> arith_exprdeclare operator(comparison) -> string %{<,>,<>,=}
Note: The arith_expr metadata type allows for
arithmetic expressions whose tips can be of type
entmet, propmet or basic (number, string, boolean)
Full example: see
http://www.csd.abdn.ac.uk/~schalmer/schema/
<rdfs:Class rdf:ID="variable">
<rdfs:subClassOf
rdf:resource="#operand"/>
</rdfs:Class>
<rdf:Property rdf:ID="varname">
<rdfs:domain
rdf:resource="#variable"/>
<rdfs:range
rdf:resource=
"http://www.w3.org/2000/01/rdf-schema#Literal"/>
</rdf:Property>
<rdfs:Class rdf:ID="setmem">
<rdfs:subClassOf
rdf:resource="#boolprim"/>
</rdfs:Class>
<rdf:Property rdf:ID="var">
<rdfs:domain
rdf:resource="#setmem"/>
<rdfs:range
rdf:resource="#variable"/>
</rdf:Property>
<rdf:Property rdf:ID="set">
<rdfs:domain
rdf:resource="#setmem"/>
<rdfs:range
rdf:resource="#setexpr"/>
</rdf:Property>