60 likes | 179 Views
Translation from XML (and other sufficiently described input) to RDF/OWL. 91.514,Term Project Professor Levkowitz, Umass Lowell 05/02/2011 LPImmes 508 579 2683 lpimmes@townisp.com. Review; Focus. Review RDF/OWL and semantic web in: Paper #1 RDF/OWL Ambiguity, Mercury Modes Reconciliation.
E N D
Translation from XML (and other sufficiently described input) to RDF/OWL 91.514,Term ProjectProfessor Levkowitz, Umass Lowell05/02/2011LPImmes508 579 2683lpimmes@townisp.com
Review; Focus • Review RDF/OWL and semantic web in: • Paper #1 • RDF/OWL Ambiguity, Mercury Modes Reconciliation. • Paper #2 • RDF/OWL Knowledge Engineering. • Focus is on two demonstrations, shown on laptop with running code.
Environment • Protege, 4.1.0, build 226 • Eclipse • Groovy plugin required. • Load our workspace for demo. • Java 1.6/groovy-1-2.8.0
1st: TransXMLtoOwlqWrks.groovy • Input /Users/lpimmes/Documents/lpimmesOnly/UMassLowell/91.514/project/testrange20f.xml /Users/lpimmes/Documents/lpimmesOnly/UMassLowell/91.514/project/ • AFRL_network/hwb_core_IMPORT_THEN_MODIFY.owl • Processing • TransXMLtoOwlqWrks.java translates .xml into .owl, rdf/owl (not .ttl) format. • Update *.owl with new subclasses, instances(concat '-', of tokens). • Write new .xml via groovy's append RDF.appendNode{...} • Parse .xml path via groovy's slurper to find token to translate RDF = new XmlSlurper().parse(owlOut) • Output • New *.owl is loadable into protege; new entities appear. /Users/lpimmes/Documents/lpimmesOnly/UMassLowell/91.514/project/AFRL_network/hwb_core_TstRng20f.owl
2nd: VisioCnvrt.groovy • Input String: 'Ethernet.46-652 - PC.45-5, Ethernet.46-652 - Server.11-49, Ethernet.46-652 – PC.45-66...' (External xml program has yielded this string; no need to put back to .xml.) Fname: viso.owl ;; changeable, and still loads Semantic hdr: 'www.semanticweb.org/ontologies/2011/4' ;; changeable and still loads • Processing • VisioCnvrt.groovy outputs fname in .ttl format, loadable in protege. • Internal .ttl format much easier to generate code vs. rdf/owl. • Entire file generated: namespaces, subclasses, relationship(s), instances derived from relationships. • Mary Loves John, Sue loves Mike; People Love People. • Output • /Users/lpimmes/Documents/workspace/ulowellGroovy/visio.owl.
Future Work Externalize implicit inputs: • Subclass hierarchy: • Map hier = ['subnet': 'Ethernet', ...]. • Instance membership: Map xmlpathsCls = ['testrange.recipes.recipe.baseOS.@edition': 'Edition', ...], • XmlPathStr as in first demonstration. • Relationship(object properties) map: • Map rlns = ['connectsTo':['Node', 'Node'], ...] • Generate instances only, model only. • Allow for >1 importable *.owl files, • As in first demonstration. • Output .owl should be URL, not file://...