ããããŒã°
ããžãã¯ããã°ã©ãã³ã°ãšPrologèšèªããå§ããŸããããäž»é¡åéã«é¢ããç¥èã¯ãäžé£ã®äºå®ãšèŠåãšããŠãã®äžã«æ瀺ãããŸããäºå®ã¯å³æã®ç¥èã説æããŸããåã®æçš¿ã®äŸã®é¡§å®¢ïŒIDãååãé»åã¡ãŒã«ã¢ãã¬ã¹ïŒãšè«æ±æžïŒã¢ã«ãŠã³ãIDã顧客ãæ¥ä»ãæ¯æé¡ãæ¯æé¡ïŒã«é¢ããäºå®ã¯æ¬¡ã®ããã«ãªããŸãã
client(1, "John", "john@somewhere.net").
bill(1, 1,"2020-01", 100, 50).
ã«ãŒã«ã¯ãä»ã®ã«ãŒã«ãäºå®ããæšæž¬ã§ããæœè±¡çãªç¥èãèšè¿°ããŸããã«ãŒã«ã¯é ãšäœã§æ§æãããŠããŸããã«ãŒã«ã®å é ã§ããã®ååãšåŒæ°ã®ãªã¹ããæå®ããå¿ èŠããããŸããã«ãŒã«ã®æ¬äœã¯ãè«çæŒç®ANDïŒã³ã³ãã§æå®ïŒããã³ORïŒã»ãã³ãã³ã§æå®ïŒã«ãã£ãŠæ¥ç¶ãããè¿°èªã®ãªã¹ãã§ããè¿°èªã¯ããã¡ã¯ããã«ãŒã«ããŸãã¯æ¯èŒæŒç®ãç®è¡æŒç®ãªã©ã®çµã¿èŸŒã¿è¿°èªã«ããããšãã§ããŸããã«ãŒã«ãããã®åŒæ°ãšæ¬äœã®è¿°èªã®åŒæ°ãšã®é¢ä¿ã¯ãããŒã«å€æ°ã䜿çšããŠèšå®ãããŸããåãå€æ°ã2ã€ã®ç°ãªãåŒæ°ã®äœçœ®ã«ããå Žåãããã¯ããããã®åŒæ°ãåäžã§ããããšãæå³ããŸããã«ãŒã«æ¬äœã®è«çåŒãtrueã®å Žåãã«ãŒã«ã¯trueãšèŠãªãããŸãããã¡ã€ã³ã¢ãã«ã¯ãäžé£ã®åç §ã«ãŒã«ãšããŠå®çŸ©ã§ããŸãã
unpaidBill(BillId, ClientId, Date, AmoutToPay, AmountPaid) :- bill(BillId, ClientId, Date, AmoutToPay, AmountPaid), AmoutToPay < AmountPaid.
debtor(ClientId, Name, Email) :- client(ClientId, Name, Email), unpaidBill(BillId, ClientId, _, _, _).
2ã€ã®ã«ãŒã«ãèšå®ããŸãããæåã«ãæªæãã®è«æ±é¡ããå°ãªãè«æ±æžã¯ãã¹ãŠæªæãã®è«æ±æžã§ãããšäž»åŒµããŸãã第äºã«ãåµåè ã¯å°ãªããšã1ã€ã®æªæãã®è«æ±æžãæã£ãŠããã¯ã©ã€ã¢ã³ãã§ãã
Prologã®æ§æã¯éåžžã«åçŽã§ããããã°ã©ã ã®äž»ãªèŠçŽ ã¯ã«ãŒã«ã§ãããã«ãŒã«ã®äž»ãªèŠçŽ ã¯è¿°èªãè«çæŒç®ãããã³å€æ°ã§ããã«ãŒã«ã§ã¯ãå€æ°ã«æ³šæãåããããŸããå€æ°ã¯ã¢ãã«åãããäžçã®ãªããžã§ã¯ãã®åœ¹å²ãæãããè¿°èªã¯ãããã®ããããã£ãšãããã®éã®é¢ä¿ãèšè¿°ããŸããåµåè ã«ãŒã«ã®å®çŸ©ã§ã¯ãClientIdãNameãããã³Emailãªããžã§ã¯ããã¯ã©ã€ã¢ã³ããšunpaidBillã®é¢ä¿ã«ãã£ãŠé¢é£ä»ããããŠããå Žåãããããåµåè ã®é¢ä¿ã«ãã£ãŠé¢é£ä»ãããããšè¿°ã¹ãŠããŸãã Prologã¯ãåé¡ãäžé£ã®ã«ãŒã«ãã¹ããŒãã¡ã³ãããŸãã¯è«çã¹ããŒãã¡ã³ããšããŠå®åŒåãããå Žåã«åœ¹ç«ã¡ãŸããããšãã°ãèªç¶èšèªã®ææ³ãã³ã³ãã€ã©ããšãã¹ããŒãã·ã¹ãã ã§äœæ¥ããå Žåãã³ã³ãã¥ãŒã¿ãã³ã³ãã¥ãŒã¿ãããã¯ãŒã¯ãã€ã³ãã©ã¹ãã©ã¯ãã£ãªããžã§ã¯ããªã©ã®è€éãªã·ã¹ãã ãåæããå Žåã§ããç¹éãè€éãªã«ãŒã«ã·ã¹ãã ã¯ãæ瀺çã«èª¬æããPrologã©ã³ã¿ã€ã ã«ä»»ããŠèªåçã«åŠçããã®ãæé©ã§ãã
ããããŒã°ã¯äžæ¬¡ããžãã¯ã«åºã¥ããŠããŸãïŒé«æ¬¡ããžãã¯ã®ããã€ãã®èŠçŽ ãå«ãŸããŠããŸãïŒãæšè«ã¯ãSLD解決ïŒéžæçç·åœ¢ç¢ºå®å¥è§£æ±ºïŒãšåŒã°ããæé ã䜿çšããŠå®è¡ãããŸããåçŽåãããšããã®ã¢ã«ãŽãªãºã ã¯ãã¹ãŠã®å¯èœãªãœãªã¥ãŒã·ã§ã³ã®ããªãŒãã©ããŒãµã«ã§ããæšè«æé ã¯ãã«ãŒã«æ¬äœã®æåã®è¿°èªã®ãã¹ãŠã®è§£ãèŠã€ããŸãããã¬ããžããŒã¹ã®çŸåšã®è¿°èªãäºå®ã®ã¿ã§è¡šãããŠããå Žåã解決çã¯ãå€æ°ã®å€ãžã®çŸåšã®ãã€ã³ãã«å¯Ÿå¿ãããã®ã§ããã«ãŒã«ã«ããå Žåã¯ããã¹ããããè¿°èªã®ååž°çãªãã§ãã¯ãå¿ èŠã§ãã解決çãèŠã€ãããªãå ŽåãçŸåšã®æ€çŽ¢ãã©ã³ãã¯å€±æããŸãã次ã«ãèŠã€ãã£ãéšåçãªãœãªã¥ãŒã·ã§ã³ããšã«æ°ãããã©ã³ããäœæãããŸããåãã©ã³ãã§ãæšè«æé ã¯èŠã€ãã£ãå€ãå€æ°ã«ãã€ã³ãããŸããçŸåšã®è¿°èªã«å«ãŸããè¿°èªã®æ®ãã®ãªã¹ãã®è§£æ±ºçãååž°çã«æ€çŽ¢ããŸããè¿°èªãªã¹ãã®æåŸã«éãããšãäœæ¥ã¯çµäºããŸããã«ãŒã«ãååž°çã«å®çŸ©ããå Žåããœãªã¥ãŒã·ã§ã³ã®æ€çŽ¢ã¯ç¡éã®ã«ãŒãã«å ¥ãå¯èœæ§ããããŸããæ€çŽ¢æé ã®çµæã¯ãããŒã«å€æ°ãžã®å€ã®ãã¹ãŠã®å¯èœãªãã€ã³ãã£ã³ã°ã®ãªã¹ãã§ãã
äžèšã®åµåè ã«ãŒã«ã®äŸã§ã¯ã解決ã«ãŒã«ã¯æåã«ã¯ã©ã€ã¢ã³ãè¿°èªã®1ã€ã®ãœãªã¥ãŒã·ã§ã³ãèŠã€ãããããããŒã«å€ã«é¢é£ä»ããŸãïŒClientId = 1ãName = "John"ãEmail = "john@somewhere.net"ã次ã«ããã®å€æ°å€ã®ããªã¢ã³ãã«å¯ŸããŠã次ã®è¿°èªunpaidBillã«å¯ŸããŠãœãªã¥ãŒã·ã§ã³ãå®è¡ãããŸãããããè¡ãã«ã¯ãClientId = 1ã®å Žåãæåã«è¿°èªè«æ±æžã®è§£æ±ºçãèŠã€ããå¿ èŠããããŸããçµæã¯ãå€æ°BillId = 1ãDate = "2020-01"ãAmoutToPay = 100ãAmountPaid = 50ã®ãã€ã³ãã£ã³ã°ã«ãªããŸããæåŸã«ãAmoutToPay <AmountPaidããã§ãã¯ãããŸããçµã¿èŸŒã¿ã®æ¯èŒè¿°èªã§ã
ã»ãã³ãã£ãã¯ãããã¯ãŒã¯
ã»ãã³ãã£ãã¯ãããã¯ãŒã¯ã¯ãç¥èãè¡šãæãäžè¬çãªæ¹æ³ã®1ã€ã§ããã»ãã³ãã£ãã¯Webã¯ãæåã°ã©ã圢åŒã®ãµããžã§ã¯ããšãªã¢ã®æ å ±ã¢ãã«ã§ããã°ã©ãã®é ç¹ã¯ãã¡ã€ã³ã®æŠå¿µã«å¯Ÿå¿ããå匧ã¯ãããã®éã®é¢ä¿ãå®çŸ©ããŸãã
ããšãã°ãäžã®å³ã®ã°ã©ãã«ãããšããã¯ãžã©ãã®æŠå¿µã¯ããåºä¹³é¡ãã®æŠå¿µãšãisãïŒãisãïŒã®é¢ä¿ã«é¢é£ä»ãããããæ°Žãã®æŠå¿µã«ãäœãã§ããããšé¢é£ä»ããããŠããŸãããããã£ãŠããµããžã§ã¯ãé åã®æ§é ïŒå«ãŸããæŠå¿µãšããããäºãã«ã©ã®ããã«é¢é£ããŠãããïŒãæ£åŒã«èšå®ã§ããŸãããããŠããã®ãããªã°ã©ãã䜿çšããŠã質åã«å¯ŸããçããèŠã€ããããããæ°ããç¥èãåŒãåºãããšãã§ããŸããããšãã°ãé¢ä¿ãisããã¯ã©ã¹ãšãµãã¯ã©ã¹ã®é¢ä¿ã瀺ãããµãã¯ã©ã¹ãWhaleãããã®ã¯ã©ã¹ãMammalãã®ãã¹ãŠã®ããããã£ãç¶æ¿ããå¿ èŠããããšå€æããå ŽåãWhaleããSpineããæã£ãŠãããšããç¥èãæšæž¬ã§ããŸãã
RDF
ã»ãã³ãã£ãã¯Webã¯ããã·ã³åŠçã«é©ãã圢åŒã§æ å ±ã®è¡šç€ºãæšæºåããããšã«ãããWorld WideWebã®ãªãœãŒã¹ã«åºã¥ããŠã°ããŒãã«ã»ãã³ãã£ãã¯ãããã¯ãŒã¯ãæ§ç¯ããè©Šã¿ã§ãããã®ããã«ãæ å ±ã¯HTMLã¿ã°ã®ç¹å¥ãªå±æ§ã®åœ¢åŒã§HTMLããŒãžã«è¿œå ã§åã蟌ãŸããŸããããã«ãããã³ã³ãã³ãã®æå³ããªã³ãããžãŒã®åœ¢åŒïŒäžé£ã®äºå®ãæœè±¡çãªæŠå¿µãããã³ãããã®éã®é¢ä¿ïŒã§èšè¿°ããããšãã§ããŸãã
WEBãªãœãŒã¹ã®ã»ãã³ãã£ãã¯ã¢ãã«ãèšè¿°ããããã®æšæºçãªã¢ãããŒãã¯ãRDFïŒãªãœãŒã¹èšè¿°ãã¬ãŒã ã¯ãŒã¯ãŸãã¯ãªãœãŒã¹èšè¿°ãã¬ãŒã ã¯ãŒã¯ïŒã§ããããã«ãããšããã¹ãŠã®ã¹ããŒãã¡ã³ãã¯ãããªãã¬ããããµããžã§ã¯ã-è¿°èª-ãªããžã§ã¯ããã®åœ¢åŒã§ããå¿ èŠããããŸããããšãã°ããã¯ãžã©ãã®æŠå¿µã«é¢ããç¥èã¯æ¬¡ã®ããã«è¡šãããŸãããã¯ãžã©ãã¯äž»é¡ã§ããããäœãã§ããã-è¿°èªããæ°Žã-ãªããžã§ã¯ãã§ãããã®ãããªã¹ããŒãã¡ã³ãã®ã»ããå šäœã¯ãæåã°ã©ãã䜿çšããŠèšè¿°ã§ããŸãããµããžã§ã¯ããšãªããžã§ã¯ãã¯ãã®é ç¹ã§ãããè¿°èªã¯ã¢ãŒã¯ã§ãããè¿°èªã¢ãŒã¯ã¯ãªããžã§ã¯ããããµããžã§ã¯ãã«åããããŸããããšãã°ãåç©ã®äŸã®ãªã³ãããžãŒã¯æ¬¡ã®ããã«èª¬æã§ããŸãã
@prefix : <...some URL...>
@prefix rdf: <http://www.w3.org/1999/02/rdf-schema#>
@prefix rdfs: <http://www.w3.org/2000/01/22-rdf-syntax-ns#>
:Whale rdf:type :Mammal;
:livesIn :Water.
:Fish rdf:type :Animal;
:livesIn :Water.
ãã®è¡šèšã¯ã¿ãŒãã«ãšåŒã°ãã人éãèªããããã«æå³ãããŠããŸãããã ããXMLãJSON圢åŒããŸãã¯HTMLããã¥ã¡ã³ãã®ã¿ã°ãšå±æ§ã䜿çšããŠåãããšãèšè¿°ã§ããŸããTurtleè¡šèšã§ã¯ãè¿°èªãšãªããžã§ã¯ããäž»é¡ããšã«ã°ã«ãŒãåããŠèªã¿ãããããããšãã§ããŸãããã»ãã³ãã£ãã¯ã¬ãã«ã§ã¯ãåããªãã¬ããã¯ç¬ç«ããŠããŸãã
RDFã¯ãããŒã¿ã¢ãã«ãè€éã§ãå€æ°ã®ãªããžã§ã¯ãã¿ã€ããšãããã®éã®é¢ä¿ãå«ãŸããŠããå Žåã«åœ¹ç«ã¡ãŸããããšãã°ãWikipediaã¯ãRDF圢åŒã®èšäºã®ã³ã³ãã³ããžã®ã¢ã¯ã»ã¹ãæäŸããŸããèšäºã«èšèŒãããŠããäºå®ã¯æ§é åãããŠãããä»ã®èšäºããã®äºå®ãå«ãããããã®ç¹æ§ãšé¢ä¿ã説æãããŠããŸãã
RDFS
RDFã¢ãã«ã¯ã°ã©ãã§ããããã©ã«ãã§ã¯ãè¿œå ã®ã»ãã³ãã£ã¯ã¹ã¯å«ãŸããŠããŸããã誰ããã°ã©ãå ã®ãªã³ã¯ãé©åãšæãããããã«è§£éã§ããŸããRDFã¹ããŒãïŒRDFäžã«ãªã³ãããžãŒãæ§ç¯ããããã®ã¯ã©ã¹ãšããããã£ã®ã»ããïŒã䜿çšããŠãããã€ãã®æšæºãªã³ã¯ãè¿œå ã§ããŸããRDFSã䜿çšãããšãç¹å®ã®ã¯ã©ã¹ãžã®ãªãœãŒã¹ã®åž°å±ãã¯ã©ã¹éã®éå±€ãããããã£ã®éå±€ãªã©ãæŠå¿µéã®æšæºçãªé¢ä¿ãèšè¿°ãããµããžã§ã¯ããšãªããžã§ã¯ãã®å¯èœãªã¿ã€ããå¶éã§ããŸãã
ããšãã°ãã¹ããŒãã¡ã³ã
:Mammal rdfs:subClassOf :Animal.
ãMammalãããAnimalããšããæŠå¿µã®ãµãã¯ã©ã¹ã§ããããã®ãã¹ãŠã®ããããã£ãç¶æ¿ããããšãæå®ããŸãããããã£ãŠããã¯ãžã©ãã®æŠå¿µã¯ããåç©ãã®ã¯ã©ã¹ã«ãèµ·å ããå¯èœæ§ããããŸãããããããã®ããã«ã¯ããåºä¹³é¡ããšãåç©ãã®æŠå¿µãã¯ã©ã¹ã§ããããšãææããå¿ èŠããããŸãã
:Animal rdf:type rdfs:Class.
:Mammal rdf:type rdfs:Class.
ãŸããè¿°èªã¯ããã®ãµããžã§ã¯ããšãªããžã§ã¯ãã®å¯èœãªå€ã«å¶çŽãèšå®ã§ããŸãã
ã¹ããŒãã¡ã³ã
:livesIn rdfs:range :Environment.
ãlivesinãé¢ä¿ã®ãªããžã§ã¯ãã¯ãåžžã«ã¯ã©ã¹ãEnvironmentãã«å±ãããªãœãŒã¹ã§ããå¿ èŠãããããšã瀺ããŸãããããã£ãŠããæ°Žãã®æŠå¿µã¯ãç°å¢ãã®æŠå¿µã®ãµãã¯ã©ã¹ã§ãããšããã¹ããŒãã¡ã³ããè¿œå ããå¿ èŠããããŸãã
:Water rdf:type :Environment.
:Environment rdf:type rdfs:Class
RDFSã䜿çšãããšãããŒã¿ã¹ããŒããèšè¿°ããŠãã¯ã©ã¹ãããããã£ãåæãããããã®éå±€ãšå€ã®å¶éãèšå®ã§ããŸãããããŠRDFã¯ããã®ã¹ããŒããå ·äœçãªäºå®ã§æºããããããã®éã®é¢ä¿ãå®çŸ©ããããšã§ããããã§ããã®ã°ã©ãã«ã€ããŠè³ªåã§ããŸããããã¯ãSQLã«äŒŒãç¹å¥ãªã¯ãšãªèšèªSPARQLã§å®è¡ã§ããŸãã
SELECT ?creature
WHERE {
?creature rdf:type :Animal;
:livesIn :Water.
}
ãã®ã¯ãšãªã¯ããWhaleããšãFishãã®2ã€ã®å€ãè¿ããŸãã
ã¢ã«ãŠã³ããšé¡§å®¢ã«é¢ãã以åã®åºçç©ã®äŸã¯ããããã次ã®ããã«å®è£ ã§ããŸããRDFã䜿çšãããšãããŒã¿ã¹ããŒããèšè¿°ããå€ãå ¥åã§ããŸãã
:Client1 :name "John";
:email "john@somewhere.net".
:Client2 :name "Mary";
:email "mary@somewhere.net".
:Bill_1 :client :Client1;
:date "2020-01";
:amountToPay 100;
:amountPaid 50.
:Bill_2 :client :Client2;
:date "2020-01";
:amountToPay 80;
:amountPaid 80.
ãããããã®ã·ãªãŒãºã®æåã®èšäºã®ãåµåè ãããæªæãã®è«æ±æžããªã©ã®æœè±¡çãªæŠå¿µã«ã¯ãç®è¡æŒç®ãšæ¯èŒãå«ãŸããŠããŸãããããã¯ãæŠå¿µã®ã»ãã³ãã£ãã¯ãããã¯ãŒã¯ã®éçæ§é ã«é©åããŸããããããã®æŠå¿µã¯ãSPARQLã¯ãšãªã䜿çšããŠè¡šçŸã§ããŸãã
SELECT ?clientName ?clientEmail ?billDate ?amountToPay ?amountPaid
WHERE {
?client :name ?clientName;
:email ?clientEmail.
?bill :client ?client;
:date ?billDate;
:amountToPay ?amountToPay;
:amountPaid ?amountPaid.
FILTER(?amountToPay > ?amountPaid).
}
WHEREå¥ã¯ãããªãã«ãã¿ãŒã³ãšãã£ã«ã¿ãŒæ¡ä»¶ã®ãªã¹ãã§ããããŒã«å€æ°ã¯ãååããïŒãã§å§ãŸãããªãã¬ããã«çœ®ãæããããšãã§ããŸããã¯ãšãªãšã°ãŒãã¥ãŒã¿ã®ã¿ã¹ã¯ã¯ããã¹ãŠã®ããªãã¬ãããã¿ãŒã³ãã°ã©ãã«å«ãŸãããã£ã«ã¿ãªã³ã°æ¡ä»¶ãæºããããå€æ°ã®ãã¹ãŠã®å¯èœãªå€ãèŠã€ããããšã§ãã
ã«ãŒã«ã䜿çšããŠä»ã®ã«ãŒã«ãäœæã§ããPrologãšã¯ç°ãªããRDFã§ã¯ã¯ãšãªã¯SemanticWebã®äžéšã§ã¯ãããŸããããªã¯ãšã¹ããå¥ã®ãªã¯ãšã¹ãã®ããŒã¿ãœãŒã¹ãšããŠåç §ããããšã¯ã§ããŸããã確ãã«ãSPARQLã«ã¯ã¯ãšãªçµæãã°ã©ããšããŠè¡šãæ©èœããããŸãããããã£ãŠãã¯ãšãªçµæãå ã®ã°ã©ããšçµã¿åãããŠãçµã¿åãããã°ã©ãã§æ°ããã¯ãšãªãå®è¡ããããšãã§ããŸãããããããã®ãããªæ±ºå®ã¯æããã«RDFã®ã€ããªãã®ãŒãè¶ ããŸãã
OWL
ã»ãã³ãã£ãã¯Webãã¯ãããžãŒã®éèŠãªã³ã³ããŒãã³ãã¯OWLïŒWeb Ontology LanguageïŒã§ããããã¯ãªã³ãããžãŒãèšè¿°ããããã®èšèªã§ããRDFSã®èªåœã§ã¯ãæŠå¿µéã®æãåºæ¬çãªé¢ä¿ãã€ãŸãã¯ã©ã¹ãšé¢ä¿ã®éå±€ã®ã¿ãè¡šçŸã§ããŸããOWLã¯ãã¯ããã«è±å¯ãªèªåœãæäŸããŸããããšãã°ã2ã€ã®ã¯ã©ã¹ïŒãŸãã¯2ã€ã®ãšã³ãã£ãã£ïŒãåçïŒãŸãã¯ç°ãªãïŒã§ããããšãæå®ã§ããŸãããã®ã¿ã¹ã¯ã¯ããªã³ãããžãŒãçµã¿åããããšãã«ããçºçããŸãã
亀差ãçµåããŸãã¯ä»ã®ã¯ã©ã¹ã®è¿œå ã«åºã¥ããŠãè€åã¯ã©ã¹ãäœæã§ããŸãã
- 亀差ããå Žåãè€åã¯ã©ã¹ã®ãã¹ãŠã®ã€ã³ã¹ã¿ã³ã¹ã¯ããã¹ãŠã®ãœãŒã¹ã¯ã©ã¹ã«ãé©çšãããå¿ èŠããããŸããããšãã°ããMarine Mammalãã¯ããMammalããšãSeaDwellerãã®äž¡æ¹ã§ããå¿ èŠããããŸãã
- . , , «» «», «» «». «».
- , . , «» «».
- . , .
- â , .
æŠå¿µããªã³ã¯ã§ãããããªåŒã¯ãã³ã³ã¹ãã©ã¯ã¿ãŒãšåŒã°ããŸãã
OWLã§ã¯ãå€ãã®éèŠãªé¢ä¿ããããã£ãèšå®ããããšãã§ããŸãã
- éæž¡æ§ãé¢ä¿PïŒxãyïŒãšPïŒyãzïŒãæãç«ã€å Žåãé¢ä¿PïŒxãzïŒãæºããããŸãããã®ãããªé¢ä¿ã®äŸãšããŠã¯ããå€ãã-ãå°ãªãããã芪ã-ãåããªã©ããããŸãã
- 察称ãé¢ä¿PïŒxãyïŒãæºãããããšãé¢ä¿PïŒyãxïŒãæºããããŸããããšãã°ãçžå¯Ÿçãªé¢ä¿ã
- æ©èœäŸåãé¢ä¿PïŒxãyïŒãšPïŒxãzïŒãæãç«ã€å Žåãyãšzã®å€ã¯åäžã§ãªããã°ãªããŸãããäŸã¯ç¶ã®é¢ä¿ã§ã-人ã¯2人ã®ç°ãªãç¶ãæã€ããšã¯ã§ããŸããã
- é¢ä¿ã®é転ãé¢ä¿P1ïŒxãyïŒãæºããããå Žåããã1ã€ã®é¢ä¿P2ïŒyãxïŒãæºããããå¿ èŠãããããšãæå®ã§ããŸãããã®ãããªé¢ä¿ã®äŸã¯ã芪åé¢ä¿ã§ãã
- é¢ä¿ãã§ãŒã³ãAãBã®ããããã£ã«é¢é£ä»ããããBãCã«é¢é£ä»ããããŠããå ŽåãAïŒãŸãã¯CïŒã¯ç¹å®ã®ã¯ã©ã¹ã«å±ããããã«èšå®ã§ããŸããããšãã°ãAã«Bã®ç¶èŠªãããŠãç¶èŠªBã«ç¶èŠªCãããå ŽåãAã¯Cã®å«ã§ãã
é¢ä¿ã®åŒæ°ã®å€ã«å¶éãèšå®ããããšãã§ããŸããããšãã°ãåŒæ°ãåžžã«ç¹å®ã®ã¯ã©ã¹ã«å±ããŠããå¿ èŠãããããšãã¯ã©ã¹ã«ç¹å®ã®ã¿ã€ãã®é¢ä¿ãå°ãªããšã1ã€ããå¿ èŠãããããšããŸãã¯ãã®ã¿ã€ãã®é¢ä¿ã®æ°ãå¶éããããšãæå®ããŸãããŸãã¯ãç¹å®ã®é¢ä¿ã«ãã£ãŠç¹å®ã®å€ã«é¢é£ä»ããããŠãããã¹ãŠã®ã€ã³ã¹ã¿ã³ã¹ãç¹å®ã®ã¯ã©ã¹ã«å±ããããã«æå®ã§ããŸãã
OWLã¯çŸåšããªã³ãããžãŒãæ§ç¯ããããã®äºå®äžã®æšæºããŒã«ã§ãããã®èšèªã¯ãRDFSããã倧èŠæš¡ã§è€éãªãªã³ãããžãŒã®æ§ç¯ã«é©ããŠããŸãã OWLæ§æã䜿çšãããšãæŠå¿µã®ããŸããŸãªããããã£ãšãããã®éã®é¢ä¿ãè¡šçŸã§ããŸãããã ããããã€ãã®è¿œå ã®å¶éãå°å ¥ãããŸããããšãã°ãåãæŠå¿µãã¯ã©ã¹ãšããŠãå¥ã®ã¯ã©ã¹ã®ã€ã³ã¹ã¿ã³ã¹ãšããŠãåæã«å®£èšããããšã¯ã§ããŸããã OWLãªã³ãããžãŒã¯ããå³å¯ã§ãããæšæºåãããŠãããããããèªã¿ããããªã£ãŠããŸãã RDFSãRDFã°ã©ãã®äžã«ããããã€ãã®è¿œå ã¯ã©ã¹ã§ããå ŽåãOWLã«ã¯ç°ãªãæ°åŠçåºç€ïŒèšè¿°ããžãã¯ïŒããããŸãããããã£ãŠãOWLãªã³ãããžãŒããæ°ããæ å ±ãæœåºãããããã®äžè²«æ§ããã§ãã¯ããŠè³ªåã«çããããšãã§ããæ£åŒãªæšè«æé ãå©çšå¯èœã«ãªããŸãã
èšè¿°ããžãã¯ã¯ã1次ããžãã¯ã®äžéšã§ãã 1ã€ã®å Žæã®è¿°èªïŒããšãã°ãæŠå¿µãã¯ã©ã¹ã«å±ããïŒã2ã€ã®å Žæã®è¿°èªïŒæŠå¿µã«ã¯ããããã£ãšãã®å€ããããŸãïŒãããã³äžèšã®ã¯ã©ã¹ã³ã³ã¹ãã©ã¯ã¿ãŒãšé¢ä¿ããããã£ã®ã¿ãèš±å¯ãããŸããèšè¿°è«çã«ãããäžæ¬¡è«çã®ä»ã®ãã¹ãŠã®è¡šçŸã¯åé€ãããŸãããããšãã°ããæªæãã®è«æ±æžãã®æŠå¿µããè«æ±æžãã¯ã©ã¹ã«å±ãããè«æ±æžãã®æŠå¿µã«ãæ¯æãããéé¡ãããã³ãæ¯æãããéé¡ãã®ããããã£ããããšããã¹ããŒãã¡ã³ãã¯åãå ¥ããããŸãããã ãããæªæãã®è«æ±æžãããããã£ãæ¯æãããéé¡ãã®æŠå¿µã¯ãããããã£ãæ¯æãããéé¡ãããã倧ããããå¿ èŠãããããšãè¡šæããããšã¯ã§ããŸãããããã«ã¯ããããã®ããããã£ãæ¯èŒããããã®è¿°èªãå«ãã«ãŒã«ãå¿ èŠã§ããæ®å¿µãªãããOWLã³ã³ã¹ãã©ã¯ã¿ãŒã¯ãããèš±å¯ããŸããã
ãããã£ãŠãèšè¿°çè«çã®è¡šçŸåã¯ãäžæ¬¡è«çã®è¡šçŸåãããäœãããããäžæ¹ã§ãèšè¿°ããžãã¯ã®æšè«ã¢ã«ãŽãªãºã ã¯ã¯ããã«é«éã§ããããã«ãããã¯æ±ºå®å¯èœæ§ã®ç¹æ§ãæã£ãŠããŸã-解決çã¯æéã®æéã§ä¿èšŒãããŠããããšãããããŸããå®éã«ã¯ããã®ãããªèªåœã¯è€éã§ããªã¥ãŒã ã®ãããªã³ãããžãŒãæ§ç¯ããã®ã«ååã§ãããšèããããŠãããOWLã¯è¡šçŸåãšæšè«å¹çã®éã®è¯ã劥åç¹ã§ãã
ãŸããSWRLïŒSemantic Web Rule LanguageïŒãèšåãã䟡å€ããããŸããããã¯ãOWLã§ã¯ã©ã¹ãšããããã£ãäœæããæ©èœãšãéå®ããŒãžã§ã³ã®Datalogèšèªã§ã«ãŒã«ãäœæããæ©èœãçµã¿åããããã®ã§ãããããã®ã«ãŒã«ã®ã¹ã¿ã€ã«ã¯ãPrologã®å Žåãšåãã§ããSWRLã¯ãæ¯èŒãæ°åŠãæååãæ¥ä»ãããã³ãªã¹ãæäœã®ããã®çµã¿èŸŒã¿è¿°èªããµããŒãããŸããããã¯ã1ã€ã®ç°¡åãªè¡šçŸã䜿çšããŠãæªæãã®è«æ±æžãã®æŠå¿µãå®è£ ããããã«ç§ãã¡ãæ¬ ããŠãããã®ã§ãã
ãããŒã©-2
ã»ãã³ãã£ãã¯ãããã¯ãŒã¯ã®ä»£ããã«ããã¬ãŒã ãªã©ã®ãã¯ãããžãŒãæ€èšããŠãã ããããã¬ãŒã ã¯ãè€éãªãªããžã§ã¯ããæœè±¡çãªã€ã¡ãŒãžãäœãã®ã¢ãã«ãèšè¿°ããæ§é ã§ããããã¯ãååãäžé£ã®ããããã£ïŒç¹æ§ïŒãããã³ãããã®å€ã§æ§æãããŸããããããã£å€ã¯å¥ã®ãã¬ãŒã ã«ããããšãã§ããŸãããŸããããããã£ã«ã¯ããã©ã«ãå€ãèšå®ã§ããŸãããã®å€ãèšç®ããããã®é¢æ°ãããããã£ã«ã¢ã¿ããã§ããŸãããã¬ãŒã ã«ã¯ããã¬ãŒã ã®äœæãåé€ãããããã£ã®å€ã®å€æŽãªã©ã®ã€ãã³ãã®ãã³ãã©ãŒãå«ããµãŒãã¹ããã·ãŒãžã£ãå«ããããšãã§ããŸãããã¬ãŒã ã®éèŠãªããããã£ã¯ãç¶æ¿ããæ©èœã§ããåãã¬ãŒã ã«ã¯ã芪ãã¬ãŒã ã®ãã¹ãŠã®ããããã£ãå«ãŸããŸãã
ãªã³ã¯ããããã¬ãŒã ã®ã·ã¹ãã ã¯ãRDFã°ã©ããšéåžžã«ãã䌌ãã»ãã³ãã£ãã¯ãããã¯ãŒã¯ã圢æããŸãããããããªã³ãããžãŒãäœæããã¿ã¹ã¯ã§ã¯ããã¬ãŒã ã¯çŸåšäºå®äžã®æšæºã§ããOWLã«åã£ãŠä»£ããããŸããã OWLã¯ããè¡šçŸåããããããé«åºŠãªçè«çåºç€ãã€ãŸãæ£åŒãªèšè¿°ããžãã¯ãåããŠããŸããæŠå¿µã®ããããã£ãäºãã«ç¬ç«ããŠèšè¿°ãããRDFããã³OWLãšã¯ç°ãªãããã¬ãŒã ã¢ãã«ã§ã¯ãæŠå¿µãšãã®ããããã£ã¯åäžã®å šäœãã€ãŸããã¬ãŒã ãšèŠãªãããŸãã RDFã¢ãã«ãšOWLã¢ãã«ã§ãã°ã©ãã®é ç¹ã«æŠå¿µã®ååãå«ãŸãããšããžã«ããããã£ãå«ãŸããŠããå Žåããã¬ãŒã ã¢ãã«ã§ã¯ãã°ã©ãã®é ç¹ã«ãã¹ãŠã®ããããã£ãæã€æŠå¿µãå«ãŸãããšããžã«ã¯ãããããã£éã®æ¥ç¶ãŸãã¯æŠå¿µéã®ç¶æ¿é¢ä¿ãå«ãŸããŸãã
ãã®å Žåããã¬ãŒã ã¢ãã«ã¯ãªããžã§ã¯ãæåã®ããã°ã©ãã³ã°ã¢ãã«ã«éåžžã«è¿ããã®ã§ãããããã¯ã»ãŒåãã§ãããã¹ã³ãŒããç°ãªããŸãããã¬ãŒã ã¯ãæŠå¿µãšãªããžã§ã¯ãéã®é¢ä¿ã®ãããã¯ãŒã¯ãã¢ãã«åããããšãç®çãšããOOPã¯ããªããžã§ã¯ãã®åäœããªããžã§ã¯ãã®çžäºäœçšãã¢ãã«åããããšãç®çãšããŠããŸãããããã£ãŠãOOPã¯ãããã³ã³ããŒãã³ãã®å®è£ ã®è©³çŽ°ãä»ã®ã³ã³ããŒãã³ãããé ããã¯ã©ã¹ã®ã¡ãœãããšãã£ãŒã«ããžã®ã¢ã¯ã»ã¹ãå¶éããããã®è¿œå ã®ã¡ã«ããºã ãæäŸããŸãã
ææ°ã®ãã¬ãŒãã³ã°èšèªïŒKL-ONEãPowerLoomãFlora-2ãªã©ïŒã¯ããªããžã§ã¯ãã¢ãã«ã®è€åããŒã¿ã¿ã€ãã1次ããžãã¯ãšçµã¿åãããŸãããããã®èšèªã§ã¯ããªããžã§ã¯ãã®æ§é ãèšè¿°ããã ãã§ãªããã«ãŒã«ã§ãããã®ãªããžã§ã¯ããæäœããããç¹å®ã®ã¯ã©ã¹ã«å±ãããªããžã§ã¯ãã®æ¡ä»¶ãèšè¿°ããã«ãŒã«ãäœæãããããããšãã§ããŸããã¯ã©ã¹ã®ç¶æ¿ãšæ§æã®ã¡ã«ããºã ã¯è«ççãªè§£éãåãåããæšè«æé ã§äœ¿çšã§ããããã«ãªããŸãããããã®èšèªã¯OWLãããè¡šçŸåãããã2ã€ã®å Žæã®è¿°èªã«éå®ãããŸããã
äŸãšããŠãFlora-2èšèªã§åµåè ã䜿çšããŠäŸãå®è£ ããŠã¿ãŸããã..ããã®èšèªã«ã¯ããã¬ãŒã ãš1次ããžãã¯ãçµã¿åãããFããžãã¯ãã¬ãŒã ããžãã¯ãä»ã®ã¹ããŒãã¡ã³ãã®æ§é ãã¡ã¿ããã°ã©ãã³ã°ã«é¢ããã¹ããŒãã¡ã³ãã圢æããããã®ããŒã«ãæäŸããé«æ¬¡ããžãã¯HiLogãè«ç圢åŒã§èš±å¯ãããã©ã³ã¶ã¯ã·ã§ã³ããžãã¯å€æŽããžãã¯ã®3ã€ã®ã³ã³ããŒãã³ããå«ãŸããŸããããŒã¿ã®å€æŽãšèšç®ã®å¯äœçšã«ã€ããŠèª¬æããŸããããã§ã¯ãFããžãã¯ãã¬ãŒã ããžãã¯ã®ã¿ã«é¢å¿ããããŸãããŸããããã䜿çšããŠãã¯ã©ã€ã¢ã³ããšåµåè ã®æŠå¿µïŒã¯ã©ã¹ïŒã説æãããã¬ãŒã ã®æ§é ã宣èšããŸãã
client[|name => \string,
email => \string
|].
bill[|client => client,
date => \string,
amountToPay => \number,
amountPaid => \number,
amountPaid -> 0
|].
ããã§ããããã®æŠå¿µã®ã€ã³ã¹ã¿ã³ã¹ïŒãªããžã§ã¯ãïŒã宣èšã§ããŸãã
client1 : client[name -> 'John', email -> 'john@somewhere.net'].
client2 : client[name -> 'Mary', email -> 'mary@somewhere.net'].
bill1 : bill[client -> client1,
date -> '2020-01',
amountToPay -> 100
].
bill2 : bill[client -> client2,
date -> '2020-01',
amountToPay -> 80,
amountPaid -> 80
].
'->'èšå·ã¯ãå±æ§ãšãªããžã§ã¯ãã®ç¹å®ã®å€ããã³ã¯ã©ã¹å®£èšã®ããã©ã«ãå€ãšã®é¢é£ä»ããæå³ããŸãããã®äŸã§ã¯ãbillã¯ã©ã¹ã®amountPaidãã£ãŒã«ãã®ããã©ã«ãå€ã¯ãŒãã§ãã'ïŒ'èšå·ã¯ãã¯ã©ã¹ã®ãšã³ãã£ãã£ãäœæããããšãæå³ããŸããclient1ãšclient2ã¯ãã¯ã©ã€ã¢ã³ãã¯ã©ã¹ã®ãšã³ãã£ãã£ã§ãã
ããã§ããæªæãã®è«æ±æžããšãåµåè ããšããæŠå¿µããã¢ã«ãŠã³ãããšãã¯ã©ã€ã¢ã³ãããšããæŠå¿µã®ãµãã¯ã©ã¹ã§ãããšå®£èšã§ããŸãã
unpaidBill :: bill.
debtor :: client.
èšå·ã::ãã¯ãã¯ã©ã¹éã®ç¶æ¿é¢ä¿ã宣èšããŸããã¯ã©ã¹ã®æ§é ãã¡ãœãããããã³ãã¹ãŠã®ãã£ãŒã«ãã®ããã©ã«ãå€ãç¶æ¿ãããŸããunpaidBillã¯ã©ã¹ãšdebtorã¯ã©ã¹ã«å±ããããšãæå®ããã«ãŒã«ã宣èšããããšã¯æ®ã£ãŠããŸãã
?x : unpaidBill :- ?x : bill[amountToPay -> ?a, amountPaid -> ?b], ?a > ?b.
?x : debtor :- ?x : client, ?_ : unpaidBill[client -> ?x].
æåã®ã¹ããŒãã¡ã³ãã¯ãå€æ°
?
ãbillãšã³ãã£ãã£ã§ããããã®amountToPayãã£ãŒã«ããamountPaidãã倧ããå Žåããã®å€æ°ã¯unpaidBillãšã³ãã£ãã£ã§ãããšè¿°ã¹ãŠããŸãã2çªç®?
ã«ãunpaidBillã¯ã©ã¹ã«å±ãããã®ïŒã¯ã©ã€ã¢ã³ãã¯ã©ã¹ã«å±ããã¯ã©ã€ã¢ã³ããã£ãŒã«ãã®å€ãå€æ°ã«çããunpaidBillã¯ã©ã¹ã®ãšã³ãã£ãã£ãå°ãªããšã1ã€ããå ŽåïŒ?
ãunpaidBillã¯ã©ã¹ã®ãã®ãšã³ãã£ãã£ã¯ãå¿åå€æ°ã«é¢é£ä»ããã?_
ããã®å€ã¯ãã以äžäœ¿çšãããŸããã
ã¯ãšãªã䜿çšããŠåµåè ã®ãªã¹ããååŸã§ããŸãã
?- ?x:debtor.
åµåè ã¯ã©ã¹ã«é¢é£ãããã¹ãŠã®å€ãèŠã€ããããã«ãé¡ãããŸããçµæã¯ãå€æ°ã®ãã¹ãŠã®å¯èœãªå€ã®ãªã¹ãã«ãªããŸã
?x
ïŒ
?x = client1
ãã¬ãŒã ããžãã¯ã¯ããªããžã§ã¯ãæåã¢ãã«ã®å¯èŠæ§ãšããžãã¯ããã°ã©ãã³ã°ã®åãçµã¿åããããã®ã§ããããŒã¿ããŒã¹ã®æäœãè€éãªã·ã¹ãã ã®ã¢ããªã³ã°ãç°çš®ããŒã¿ã®çµ±åãªã©ãæŠå¿µã®æ§é ã«çŠç¹ãåœãŠãå¿ èŠãããå Žåã«äŸ¿å©ã§ãã
SQL
æåŸã«ãSQLæ§æã®äž»ãªæ©èœãèŠãŠã¿ãŸããããååã®åºçç©ã§ã¯ãSQLã«ã¯è«ççãªçè«çåºç€ãã€ãŸããªã¬ãŒã·ã§ãã«èšç®ããããšè¿°ã¹ãLINQã§ã®åµåè ã«ããäŸã®å®è£ ãæ€èšããŸãããã»ãã³ãã£ã¯ã¹ã®èŠ³ç¹ãããSQLã¯ãã¬ãŒãã³ã°èšèªãšOOPã¢ãã«ã«è¿ãã§ã-ãªã¬ãŒã·ã§ãã«ããŒã¿ã¢ãã«ã§ã¯ãäž»èŠãªèŠçŽ ã¯ããŒãã«ã§ãããåå¥ã®ããããã£ã®ã»ãããšããŠã§ã¯ãªããå šäœãšããŠèªèãããŸãã
SQLæ§æã¯ããã®ããŒãã«ã®åãã«å®å šã«é©åããŸãããªã¯ãšã¹ãã¯ã»ã¯ã·ã§ã³ã«åå²ãããŸããããŒãã«ããã¥ãŒããã¹ããããã¯ãšãªã§è¡šãããã¢ãã«ã®ãšã³ãã£ãã£ã¯ãFROMã»ã¯ã·ã§ã³ã«ç§»åãããŸããããããã®éã®ãªã³ã¯ã¯ãJOINæäœã䜿çšããŠæå®ãããŸãããã£ãŒã«ããšä»ã®æ¡ä»¶ã®éã®äŸåé¢ä¿ã¯ãWHEREå¥ãšHAVINGå¥ã«ãããŸããè¿°èªåŒæ°ããã€ã³ãããããŒã«å€æ°ã®ä»£ããã«ãã¯ãšãªã§çŽæ¥ããŒãã«ãã£ãŒã«ããæäœããŸãããã®æ§æã¯ããç·åœ¢ãããããŒã°æ§æãããæ確ã«ãã¡ã€ã³ã¢ãã«ã®æ§é ãèšè¿°ããŸãã
ã¢ããªã³ã°èšèªã®æ§æã¹ã¿ã€ã«ã®èŠæ¹
æªæãã®è«æ±æžã®äŸã䜿çšããŠãããžãã¯ããã°ã©ãã³ã°ïŒPrologïŒããã¬ãŒã ããžãã¯ïŒFlora-2ïŒãã»ãã³ãã£ãã¯Webãã¯ãããžãŒïŒRDFSãOWLãããã³SWRLïŒããªã¬ãŒã·ã§ãã«èšç®ïŒSQLïŒãªã©ã®ã¢ãããŒããæ¯èŒã§ããŸãããããã®äž»ãªç¹åŸŽãè¡šã«ãŸãšããŸããã
èšèª | æ°åŠçæ ¹æ | ã¹ã¿ã€ã«ãªãªãšã³ããŒã·ã§ã³ | é©çšç¯å² |
---|---|---|---|
ããããŒã° | äžæ¬¡ããžã㯠| ã«ãŒã«ã«ã€ã㊠| ã«ãŒã«ããŒã¹ã®ã·ã¹ãã ããã¿ãŒã³ãããã³ã°ã |
RDFS | ã°ã©ã | æŠå¿µéã®é¢ä¿ã«ã€ã㊠| WEBãªãœãŒã¹ããŒã¿ã¹ããŒã |
OWL | èšè¿°ããžã㯠| æŠå¿µéã®é¢ä¿ã«ã€ã㊠| ãªã³ãããžãŒ |
SWRL | Datalogã®äžæ¬¡ããžãã¯ã®ç°¡ç¥ç | æŠå¿µéã®ãªã³ã¯ã«å ããŠã«ãŒã«ã«ã€ã㊠| ãªã³ãããžãŒ |
ãããŒã©-2 | ãã¬ãŒã +äžæ¬¡ããžã㯠| ãªããžã§ã¯ãæ§é ã«å ããŠã«ãŒã«ã«ã€ã㊠| ããŒã¿ããŒã¹ãè€éãªã·ã¹ãã ã®ã¢ããªã³ã°ãç°çš®ããŒã¿ã®çµ±å |
SQL | é¢ä¿èšç® | ããŒãã«æ§é ã«ã€ã㊠| ããŒã¿ããŒã¹ |
次ã«ãåæ§é åããŒã¿ãåŠçããããã«èšèšãããã¢ããªã³ã°èšèªã®æ°åŠçåºç€ãšæ§æã¹ã¿ã€ã«ãããã³æ±çšã®ãªããžã§ã¯ãæåã®æ©èœçãªããã°ã©ãã³ã°èšèªãšçµã¿åããããç°çš®ãœãŒã¹ããã®ããŒã¿çµ±åãèŠã€ããå¿ èŠããããŸãã
æãè¡šçŸåè±ããªèšèªã¯PrologãšFlora-2ã§ã-ãããã¯é«æ¬¡ããžãã¯ã®èŠçŽ ãæã€å®å šãªäžæ¬¡ããžãã¯ã«åºã¥ããŠããŸããæ®ãã®ã¢ãããŒãã¯ãã®ãµãã»ããã§ãã RDFSãé€ããŠãããã¯æ£åŒãªããžãã¯ãšã¯ãŸã£ããé¢ä¿ããããŸããããã®æ®µéã§ã¯ãæ¬æ Œçãªäžæ¬¡ããžãã¯ã奜ãŸãããªãã·ã§ã³ã®ããã«æãããŸãããããããããã«ãã ããã€ããã§ãããããããªã¬ãŒã·ã§ãã«èšç®ãŸãã¯æšè«ããŒã¿ããŒã¹ããžãã¯ã®åœ¢åŒã®éå®ããããªãã·ã§ã³ã«ãå©ç¹ããããŸãã倧éã®ããŒã¿ãåŠçãããšãã«åªããããã©ãŒãã³ã¹ãæäŸããŸããå°æ¥çã«ã¯åå¥ã«æ€èšããå¿ èŠããããŸããèšè¿°ããžãã¯ã¯å¶éãå€ãããŠãæŠå¿µéã®åçãªé¢ä¿ãè¡šçŸã§ããªãããã§ãã
ç§ã®èŠè§£ã§ã¯ãåæ§é åããŒã¿ãæäœããç°çš®ã®ããŒã¿ãœãŒã¹ãçµ±åããã«ã¯ãé¢ä¿ãšæŠå¿µã¯ã©ã¹ã«çŠç¹ãåœãŠãã«ãŒã«æåã®PrologïŒOWLïŒããããã¬ãŒã ããžãã¯ã®æ¹ãé©ããŠããŸãããã¬ãŒã ã¢ãã«ã¯ããªããžã§ã¯ãã®æ§é ãæ瀺çã«èšè¿°ãããããã«æ³šæãåããŸããå€ãã®ããããã£ãæã€ãªããžã§ã¯ãã®å Žåããã¬ãŒã 圢åŒã¯ã«ãŒã«ããµããžã§ã¯ãããããã£ãªããžã§ã¯ãããªãã¬ãããããã¯ããã«èªã¿ããããªããŸããç¶æ¿ã¯ãå埩ã³ãŒãã®éãåçã«æžããããšãã§ããéåžžã«äŸ¿å©ãªã¡ã«ããºã ã§ããããŸãããªã¬ãŒã·ã§ãã«ã¢ãã«ãšæ¯èŒãããšããã¬ãŒã ããžãã¯ã䜿çšãããšãããªãŒãã°ã©ããªã©ã®è€éãªããŒã¿æ§é ãããèªç¶ãªæ¹æ³ã§èšè¿°ããããšãã§ããŸãããããŠæãéèŠãªããšã¯ãç¥èãèšè¿°ããããã®ãã¬ãŒã ã¢ãã«ãOOPã¢ãã«ã«è¿æ¥ããŠãããããèªç¶ãªæ¹æ³ã§ãããã1ã€ã®èšèªã«çµ±åã§ããŸãã
SQLããã¯ãšãªæ§é ãåçšããããæŠå¿µã®å®çŸ©ã¯è€éãªåœ¢ããšãããšãã§ãããã®æ§æèŠçŽ ã匷調ããŠç¥èŠã容æã«ããããã«ããããã»ã¯ã·ã§ã³ã«åå²ããããšã¯å®³ã«ã¯ãªããŸããããŸããã»ãšãã©ã®éçºè ã«ãšã£ãŠãSQLæ§æã¯ããªããªãã¿ããããŸãã
ããã§ãã¢ããªã³ã°èšèªã®åºç€ãšããŠãã¬ãŒã ããžãã¯ãæ¡çšããããšæããŸãããã ããç®æšã¯ããŒã¿æ§é ãèšè¿°ããç°çš®ã®ããŒã¿ãœãŒã¹ãçµ±åããããšã§ãããããã«ãŒã«æåã®æ§æãç Žæ£ããŠãSQLããåçšããæ§é åããŒãžã§ã³ã«çœ®ãæããããšããŸãããã¡ã€ã³ã¢ãã«ã®äž»ãªèŠçŽ ã¯ãã³ã³ã»ãããïŒã³ã³ã»ããïŒã§ãããã®å®çŸ©ã«ã¯ããœãŒã¹ããŒã¿ãããšã³ãã£ãã£ãæœåºããããã«å¿ èŠãªãã¹ãŠã®æ å ±ãå«ããããšæããŸãã
- ã³ã³ã»ããã®ååã
- ãã®å±æ§ã®ã»ããã
- () , ;
- , ;
- , .
æŠå¿µã®å®çŸ©ã¯SQLã¯ãšãªã«äŒŒãŠããŸãããããŠããã¡ã€ã³ã¢ãã«å šäœãçžäºã«é¢é£ããæŠå¿µã®åœ¢ã«ãªããŸãã
次ã®åºçç©ã§ãã¢ããªã³ã°èšèªã®çµæã®æ§æã瀺ãäºå®ã§ããä»ãããããç¥ããã人ã®ããã«ãè±èªã®ç§åŠçãªã¹ã¿ã€ã«ã®å šæãããã«ãããŸãïŒ
åæ§é åããŒã¿åŠçã®ããã®ãã€ããªãããªã³ãããžãŒæåããã°ã©ãã³ã°
以åã®åºçç©ãžã®ãªã³ã¯ïŒ
ãã«ããã©ãã€ã ããã°ã©ãã³ã°èšèªã®èšèšãããŒã1-ããã¯äœã®ããã§ããïŒ
ãã«ããã©ãã€ã ããã°ã©ãã³ã°èšèªãèšèšããŸããããŒã2-PL / SQLãLINQãGraphQLã§ã®ã¢ãã«æ§ç¯ã®æ¯èŒ