Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to deploy a simple document reconciliation engine with Jena2 M. Missikoff – F. Taglino LEKS, IASI-CNR Una piattaforma inferenziale per il Web Semantico:

Similar presentations


Presentation on theme: "How to deploy a simple document reconciliation engine with Jena2 M. Missikoff – F. Taglino LEKS, IASI-CNR Una piattaforma inferenziale per il Web Semantico:"— Presentation transcript:

1 How to deploy a simple document reconciliation engine with Jena2 M. Missikoff – F. Taglino LEKS, IASI-CNR Una piattaforma inferenziale per il Web Semantico: Jena2 Roma, 2006 Web Semantico

2 2 Order Processing Buyer Process according to AIDIMA Supplier Process according to UBL Evaluating Quotation Issuing PO Receiving Goods BUYER SUPPLIER Paying Invoice Sending RFQ RFQ Quot. Purchase Order OrdConf Invoice Processing RFQ Processing PO Fulfilling PO Delivering Goods Invoicing Purchase Order

3 3 The steps 4 the deployment of a reasoner Preliminary analysis of the (paper) documents to identify the conflicts Create the RDFS files with the formal description of the two documents Identify the conflicting elements in the RDFS files Create the reconciliation rules for each identified conflict Configure the inference engine by register the namespaces used in the rdf(s) files register the new functors specify the reasoning mode load the Reconciliation Rules Acquire (create) the instance RDF document to be processed Launch the reasoner, with the RDF doc instance in input

4 4 Preliminary analysis of the two documents A sketchy Purchase Order inspired by the AIDIMA format A sketchy Purchase Order inspired by the UBL standard

5 5 Create the RDFS files with the formal description of the two documents AIDIMA … UBL

6 6 Identify the RDFS conflicting elements order header order header products info products info supplier info supplier info buyer info buyer info org info org info contact person contact person name orgName address details address details product record product record description productCode quantity … … … … … … orderNumber … … … … Order … … Buyer Party Buyer Party FirstName Party Contact LastName Telephone … … Address … … … … buyerOrderNum OrderLine LineItem Item Catalogue Indicator Catalogue Indicator Quantity … … … … order header order header buyer info buyer info org info org info contact person contact person name Order products info products info product record product record productCode Order Buyer Party Buyer Party FirstName Party Contact LastName Attribute Granularity Order OrderLine LineItemItem Catalogue Indicator AIDIMA UBL … Structure Organiz and Naming

7 7 Create the reconciliation rules [R1:(?x1 rdf:type AIDIMA:Order) (?x1 AIDIMA:has_orderHeader ?x2) (?x2 rdf:type AIDIMA:orderHeader) (?x2 AIDIMA:has_orderNumber ?x3) -> (?x1 rdf:type UBL:Order) (?x1 UBL:has_buyerOrderNum ?x3) ] … The rule for reconciliating the order number

8 8 Configure the inference engine to obtain a specific reasoner … // Register the namespace used in the rdf(s) files String aidimaURI = "http://www.aidima.es/#"; PrintUtil.registerPrefix(aidima", aidimaURI); String ublURI = "http://www.ubl.com/#"; PrintUtil.registerPrefix(ubl", ublURI); // Register the functors BuiltinRegistry.theRegistry.register( new Split() ); // Create an (RDF) specification of a forward reasoner with // AIDIMA2UBL rules. Model m = ModelFactory.createDefaultModel(); Resource configuration = m.createResource(); configuration.addProperty(ReasonerVocabulary.PROPruleMode, forward"); configuration.addProperty(ReasonerVocabulary.PROPruleSet, AIDIMA2UBL.rules"); … Registrare i propri namespace utilizzati nei file rdf(s) Specificare la modalità di reasoning Registrare i nuovi funtori Specificare il file delle regole

9 9 Acquire (create) the instance RDF document to be processed { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/4/1473967/slides/slide_9.jpg", "name": "9 Acquire (create) the instance RDF document to be processed

10 10 Launch the reasoner, with the RDF doc instance in input … // Launch the reasoner Model aidimaData = ModelLoader.loadModel("file:aidima.rdf"); InfModel infmodel = ModelFactory.createInfModel(reasoner, aidimaData); // Get the Results Model deductionsModel = infmodel.getDeductionsModel (); StmtIterator i = deductionsModel.listStatements (); while ( i.hasNext()) {System.out.println(" - " + PrintUtil.print( i.nextStatement()));} …

11 11 Implementing and using a reasoner (the Java code) // Register a namespace used in the rdf(s) files String aidimaURI = "http://www.aidima.es/#"; PrintUtil.registerPrefix(aidima", aidimaURI); String ublURI = "http://www.ubl.com/#"; PrintUtil.registerPrefix(ubl", ublURI); // Register the functors BuiltinRegistry.theRegistry.register( new Split() ); // Create an (RDF) specification of a forward reasoner with // AIDIMA2UBL rules. Model m = ModelFactory.createDefaultModel(); Resource configuration = m.createResource(); configuration.addProperty(ReasonerVocabulary.PROPruleMode, forward"); configuration.addProperty(ReasonerVocabulary.PROPruleSet, AIDIMA2UBL.rules"); // Create an instance of such a reasoner Reasoner reasoner = GenericRuleReasonerFactory.theInstance().create(configuration); // Launch the reasoner Model aidimaData = ModelLoader.loadModel("file:aidima.rdf"); InfModel infmodel = ModelFactory.createInfModel(reasoner, aidimaData); // Get the Results Model deductionsModel = infmodel.getDeductionsModel (); StmtIterator i = deductionsModel.listStatements (); while ( i.hasNext()) {System.out.println(" - " + PrintUtil.print( i.nextStatement()));} Modificare il nome del file per utilizzare le proprie regole Modificare il nome del file per utilizzare i propri dati Registrare i propri namespace utilizzati nei file rdf(s) Registrare i funtori


Download ppt "How to deploy a simple document reconciliation engine with Jena2 M. Missikoff – F. Taglino LEKS, IASI-CNR Una piattaforma inferenziale per il Web Semantico:"

Similar presentations


Ads by Google