I have downloaded a load of owl files. I want to know what are the concepts defined in these files and then want to annotate other text based off these concepts. How would this be done? Code in Java would be good. I am a beginner. Thanks in advance
You need to use either OWL API, mainly for parsing OWL, or Apache Jena, mainly for RDF. Depending on what you want to do, they have great tutorials with sample code. If you have any specific question after you have read these, post a detailed question with the error message.
Related
I am trying to visualize some drl file not using drools workbench(or business central). I've found the function to create drl file by passing value. However, I can't find the way to do opposite thing.
I expect to parse the existed drl file into some value or other format that can be easily used in my Vue project. At the moment I am looking for it in Drools souce code but can't find it.
I don't want to use drools workbench because it's not convenient enough to use. But if there are some functions or libraries in its souce code, please let me know. It's also very helpful.
I am using drools 7.0.0.final now.
Thanks for reading my question, if you have any idea, please help me.
I'm not sure about what you're trying to achieve, but let me give you some hints.
The org.drools.compiler.compiler.DrlParser in the drools-compiler module will parse the DRL and generate the PackageDescr, pretty much an AST of the rule file. Take a look at org.drools.compiler.compiler.DrlParserTest for an example.
The org.drools.compiler.builder.impl.KnowledgeBuilderImpl will create the *Impl* classes which are used by the runtime of Drools.
Alternatively you can take a look at the drools-model-compiler module, in which theres a compiler org.drools.modelcompiler.builder.ModelBuilderImpl that compiles *Descrs into a Java DSL we created recently, the executable model. see org.drools.modelcompiler.CompilerTest and org.drools.modelcompiler.PatternDSLTest
Let me know if it helps.
Good luck
I am trying to build a web site build on semantic technologies. It is a CMS, to make it simple lets say it's a blog. I need to be able to do simple CRUD operations. All data will be saved on Jena like blog posts, user informations, blog categories etc.
I have a php system. Here is the path what i am planing to follow:
Use Apache Jena as RDF Store
Use Apache Jena for storing and retrieving the data.
Write a web service on java
Communicate through web service with PHP in JSON format to view, control the data.
My main focus is to build a web site on semantic technologies.
Is there anything wrong with my approach?
If not the main question is when a user made a blog post how will i create a relation with the blog post and user.
With mysql it was just a froeign key. How can i make a relations on Jena between new blog post and existing user?
I can't see anything wrong with your approach. Maybe I would suggest to use JSON-LD as an interchange format, because Jena can read it and write it directly instead of having to create your own converters to RDF (see https://jena.apache.org/documentation/io/).
Regarding the modeling question, I strongly recommend to have a look at the SIOC vocabulary (http://rdfs.org/sioc/spec/), which aims to represent exactly what you are looking for, and more.
Another hardcore solution would be to create the pages of the website in RDF (serialized in RDF/XML), and use XSL to generate the HTML version on demand for each page. It really depends on the size of your website.
I'm developing an application where I've requested data from an external institution's website. They have informed me that the data will be provided by OAI-PMH.
Could someone show me some sample code in Java how data is extracted from a OAI-PMH ?
I wonder how different it is from reading and parsing XML data.
Thank you.
Warmest wishes,
Shoubhik
For a Java implementation, for example, you could use some already existent library, like XOAI with an easy to use API. There are some provided samples.
To extract metadata from each Record you could use a XML Parser or a XML bind approach (JAXB). For other languages, like PHP and Perl there are also other alternatives.
Good Afternoon in my timezone.
In my current web project, i have to write a flat file(with some fixed rules).After a web research i found a library which is called FlatWorm that help's me write flat files in a easy way.The problem is that there is a lack of information regarding the XML definition file.I have the FlatWorm API, but there is nothing related with the XML definition file and all the tags and attributes that build it.
Anyone that use and knows about this framework can give me a clue ?
With best regards.
Thanks in advance
I would start by RTFMing. There appears to be a fair amount of information on there that should get you kick started, including some examples you could start by modifying.
Google suggests some other examples, such as, http://javaconfessions.com/2009/04/writing-flat-files-in-java-with.html and http://andreamoz.blogspot.com/2010/12/meet-flatworm.html
Unfortunately the DTD for the XML descriptor either never existed, or at least doesn't any more. If needed, I would look through the XML parsing source to see what the flatworm library actually makes use of.
I want to try and integrate my rdf data which is in an .rdf file format with dbpedia so I can build make semantic knowledge of my rdf data. Does anyone know how I would go about doing this within Jena and Java
I believe that Jena support the SPARQL 1.1 SERVICE keyword, that lets you query across a local RDF store, and DBpedia at the same time.
There's a very brief example given here: http://www.w3.org/TR/sparql11-overview/#sparql11-federated-query
You might want to have a look at Freebase, which is a system dedicated to linking semantic data. See http://www.freebase.com/ for more info.