ASN1 file parsing using JAVA - java

One of my projects requires to me to parse an ASN.1 file, and put its data into database. Is there any JAVA api or any other way which can parse the ASN.1 file using JAVA.

There is a great list of ASN.1 Tools at http://www.itu.int/en/ITU-T/asn1/Pages/Tools.aspx which includes a section for Java Tools. There are both commercial and free tools listed here. Using a good tool will save you a lot of time and frustration when working with the details of encoding and decoding ASN.1 messages.

Related

Do you know a way to convert CopyBook to XSD in Java?

I'm trying to do it quickly with java - get CopyBook file,
and generate xsd from this CopyBook.
(I know there are some open source projects to create xml from cb,
but unfortunately, thay generate xml with items and lot of tags and attributes, and it's not XSD as
well, unfortunately)
Any help will be appreciated.
Thanks.
This might fullfill your requirments:-
cobol to xml convertor
No personal experience with this tool though.
There is no open source, Java based project, that will do this for you, as far as I know. If you need to do this on a recurrent basis, then the solution would be for you to write some Java code to generate an XSD from the metadata you've collected with the XML (there's a good SourceForge cb2xml project, if I recall).
If this is for just one time, then I suggest you download the eval version of QTAssistant (I am associated with it); there's a COBOL to XML Schema tool which will do it for you (under the Tools tab, the Enterprise Toolbox group).
There may be a couple of things that could require tweaking your COBOL copybook, depending on how you've got it - nothing different than what you would need to do when using a tool like IBM's Rational Application Developer and such to generate Java beans from a COBOL copybook.
If you get stuck, please send an email to the support address on the site.

extract information from xml file as RDF triples

Could any one please recommend a tutorial or tell me how can I build a java program for extracting information from xml files and produce the out put as RDF triples using an existing ontology. an example would be really helpful.
Thanks
There are ready-made tools that address this problem, such as XSPARQL. You can write an XSPARQL query that queries the XML and produces RDF triples as output. This example should be pretty close to what you're looking for.
Your problem is really two problems:
parsing XML
writing RDF
For Java XML parsing, there are numerous examples on the web:
Java and XML - Tutorial
Java Examples in a Nutshell, Chapter 19, XML
Working with XML: The Java/XML Tutorial
For RDF there are fewer resources, it's a much more specialized field:
What are some good Java RDF libraries?
In the past I worked with Jena – it offers a friendly API to the semantic web stack.
I would recommend the XmlToRdf Java library.
XmlToRdf offers incredibly fast conversion by using the built in Java SAX parser to stream convert your XML file to RDF. A vast selection of configurations (with sane defaults) makes it simple to adjust the conversion for your needs, including element renaming and advanced IRI generation with composite identifiers.
Output from the conversion can be written directly to file as RDF Turtle or added to a Sesame Repository or Jena Dataset for further processing. With Sesame and Jena it is possible to do further, SPARQL based, transformations on the data and outputting to formats such as RDF Turtle and JSON-LD.

Using a DiffGram in Java

I'm trying to build a web portal in Java that supports incremental changes to an XML document. I really like the diffgram technology in .Net, but I must use Java for this project. Is there a Java library that can modify an XML document object using diffgrams? We will likely be using JAXB, but I can always marshal data to build the original XML document.
I don't know anything like this in Java, at least, not based on diffgram. Maybe have a look at Open Source XML Diff Written in Java for xml diff solutions in Java. Or Google for more alternatives.
Actually, this project looks interesting: fc-xmldiff (Fuego Core XML Diff and Patch Tool). Never tested personally though.

Java ASN.1 compiler

Right now I'm using BinaryNotes to parse ASN.1 files for use in a Java project. It takes an ASN.1 definition and produces Java class(s) that let me manipulate ASN.1 files.
I've hit a wall with extension markers (...) because it doesn't support them. The source forge project page says they're coming in the next release, but the last release was nearly 2 years ago so I fear the project is dead.
Can anyone recommend an easy (and $free) replacement that does a similar thing and does support extension markers?
Have you tried Bouncy Castle.
From the site:
Bouncy Castle Crypto APIs for Java consist of the following:
A lightweight cryptography API.
A provider for the Java Cryptography Extension and the Java Cryptography Architecture.
A clean room implementation of the JCE 1.2.1.
A library for reading and writing encoded ASN.1 objects.
...
Binary Notes is unsupported, but you can try jASN1 from OpenMuc. It appears to be based in part on Binary Notes and is currently active. The jASN1 libraries are available for download on their home page, and on JCenter and Maven Central under the group org.openmuc

File format conversion library

Are there any well known solutions that meet/exceed below requirements?
conversion from multiple non-graphical document formats to and from HTML (e.g. doc<->HTML, pdf<->html, odt<->html, etc.)
command line or API (Java API is preferable)
cross-platform
commercial or open source
OpenOffice has a rich API that supports conversion between the various supported formats. Check out this question. It recommends using JODConverter.
With DocBook you can export to various output formats, but reverting is always hard. For pdf you can try iText
I (having written an all in one Tex/LaTeX -> HTML and ASCII text and RTF convertor),
would say this would be quite an undertaking.
The problem with this, is these various 'document' formats are intended for rather different purposes.
And while there are indeed such conversion tools between some of these formats,
there is often a conceptual disparity in the structure, meaning and implementation of 'document'
and it is very often is necessary to trade off on features supported by one format to hack together
an acceptable output in another.
For example, PDF is very strong in presentation, precise positioning and support for fonts, where
as HTML is more concerned about structure with practically no considuration for these things
(without CSS).
I am curious how do you envision such an API being used,
when usually someone simply wants a conversion program?

Categories

Resources