As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was wondering if there is any api or library available that provides a taxonomy for a given term in jSON.
For instance, if the argument is Shoes, it should return a data structure consisting of all the synonmys or types of shoes like Boots, Flip-flops, Slippers, Stilettos, and so on..
Thanks :)
Your best bet is to use the Java API for WordNet
http://lyle.smu.edu/~tspell/jaws/index.html
You can wrap this inside a servlet and call it via jquery in your application.
JSON is not typed by itself, you have to use another notation to add type to the data encoded in JSON. JSON-LD for example allows to add the concepts of linked data/semantic web to the json data. Using this information it is possible to query the taxonomy that defines the structure of the data.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking for a message-queue api/library for managing queues locally in java. What do you suggest to me?
I don't want to use a Client/Server architecture, I'd rather do it locally to do not add a failure point. Also, scaling out isn't a necessary for now.
[EDITED]
Is there a Message-Queue API/Library for managing queries locally in java?
Features: 1) Persistent Queues; 2) Queue management; 3) Thread-safe
Once upon a time, I looked for persistent queues and could not find good implementation. I think you have 2 options:
use a JMS implementation
use an embedded key-value database with a Map implementation, like JDBM3. Emulate a queue as a Map, where id is assigned at the moment of put as previous max id +1, and take/poll/get reads the value with minimal id.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I would like to build HTML templates with some kind of tags and have parser that will populate it with data from my source. I get data as JSON and/or POJO.
Any suggestions on such parser? SOmething simple and light is what I need. So far I know about Java Mustache. Is that the best out there?
If you are looking to do the substitution in the browser, i.e. in your html page you make an ajax request that receives a json object and you then want to replace portions of your html with whatever is in that object then you can use javascript templating, like jqote2. I've used it and had good luck.
If you are looking to make the substitutions on the java side from a pojo, before sending the html to the browser then there are plenty of options like jsp, freemarker, and velocity
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Do I need a library if I only need to make csv formatted file. I don't need reading and parsing it.
No, you don't. And even reading/parsing can be easily done with a plain JRE.
CSV is a plain (ascii-)text format with only a few rules:
rows (objects) are separated with a \n
columns (fields, attributes) are spearated with a delimiter char (usually a comma, but define whatever you need)
row and column delimiters must not be part of the field values
Unless it's a really trivial part of your application and you're absolutely sure you won't ever need to parse a CSV file, you need a CSV-serialization library.
I have tried openCSV and I'm pretty happy using it. Of course you can write your own class to handle this serialization, but a library always comes with more features at the expense of an extra dependency...
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is there Java equivalent of .Net's Automapper?
Checkout the Dozer project.
Dozer supports simple property mapping, complex type mapping, bi-directional mapping, implicit-explicit mapping, as well as recursive mapping.
It makes use of BeanUtils and extends on it.
Check out my ModelMapper. It was inspired by AutoMapper, but adds a few new things such as intelligent mapping.
ModelMapper is an intelligent object
mapping framework that eliminates the
need to manually map objects to each
other. It uses a convention-based
approach to map objects while
providing a simple refactoring safe
API for handling specific mapping
scenarios.
http://modelmapper.org
Also a brief blog post from Jimmy Bogard, the creator of AutoMapper:
http://lostechies.com/jimmybogard/2012/09/17/automapper-for-java/
You should check the open source project Beanutils from Apache Commons.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to parse some HTML in order to find the values of some attributes/tags etc.
What HTML parsers do you recommend? Any pros and cons?
NekoHTML, TagSoup, and JTidy will allow you to parse HTML and then process with XML tools, like XPath.
I have tried HTML Parser which is dead simple.
Do you need to do a full parse of the HTML? If you're just looking for specific values within the contents (a specific tag/param), then a simple regular expression might be enough, and could very well be faster.