transform Relational Database Schema to Semantics Web RDF Model - c#

I need to transform RDBS to an RDF model in my project. I did some research and found that Apache Jena can be helpful. However, I am not familiar with the Java platform (I am good at C++ and average at C# programming) so I tried to download Jena .Net, only to find that it is not available.
Can you give me some suggestions to give my project a head start? Can I download Jena .Net from somewhere else?

If you only have to access your SQL database using a RDF way, have a look at D2RQ: http://d2rq.org/
The D2RQ Platform is a system for accessing relational databases as
virtual, read-only RDF graphs. It offers RDF-based access to the
content of relational databases without having to replicate it into an
RDF store.

Are you trying to make a converter from RDBS to RDF as an exercise to improve your skills on Semweb technologies or do you really need this kind of conversion for a real life project? If the latter, then you should not start with simply an RDF API. You should take a look at D2RQ, but also at what the W3C is currently defining. The RDB2RDF working group is working on two specifications, one for directly mapping RDB data to RDF, without further implication of the user (it's called the Direct Mapping) and one for specifying customised mappings, such that you can generate RDF the way you like, according to the RDF Schema you like (it's called R2RML).
At the time I'm writing, these specs are Proposed Recommendation, which is the last step before Recommendation. There are already implementations of both specs.

Related

Easily branded site architecture

I recently attended a demo of a large-scale enterprise system, whose web pages may be customised to the point of including fields added by the client. The way I understand it, their architecture is made up of the following layers:
Database
Web service API
XML files that dictate layout
The web pages that are generated from the XML files.
When I was asked to investigate building a web portal which could be easily branded, that struck me as a good way of going about it. The question now, is how one would design it.
I understand the database and web service layers, but I am a little confused by the various possibilities for building web sites in .NET.
Considering the requirement for customisability and the architecture from above, here is how I understand the options:
Webforms - the option I am most familiar with, but it is essentially enriched HTML with code-behind. I think there will probably be a lot of work to make it work with the idea of an XML layout.
WPF - the XAML middle layer is built-in, but as I understand it, WPF can only really be used in browser applications and not websites.
Silverlight - more for building applets than websites, right?
MVC - This looks interesting, but all the demos I have seen use Entity Framework as well. It seems to me like Entity Framework with all its automatic code generation is much more suitable to applications that are all new. In my case, I have a very large database that already exists.
If none of the above are suitable, I thought of an alternative. One could do a stock standard Webforms site with a web service that returns the branding elements. That isn't quite the same as what I described at the top, but is sufficient for my needs.
Or am I barking up the wrong tree?
I think you're off on your criticism of MVC. First, you don't need to use Entity Framework, and secondly even if you did, you can do it database first to generate your entities.
Your assessments of WPF and Silverlight is pretty spot on imo.
You could do this with webforms, but I think you'll probably find doing it with MVC architecture will be cleaner. Very simply, if you use clean HTML and put all branding elements into an external CSS file (logos, colors etc), then you are half way there to a custom brand. Even a different layout could potentially be defined by the CSS file (although it might be harder for your end users to customize that look since they would need to know css pretty well)
Building additional fields is potentially more difficult:
Off the cuff, the way I'd be looking at implementing this would be a combination of my predefined fields in a standard database layout (users table with username, password, first name, etc etc) and additional support for the "customizable fields" using the Entity-attribute-value pattern
From there you will need to develop an extensible system to 1. generate a page from xml with the appropriate form elements (select, text input, textarea, etc). 2. Generate a generic model that will read the same XML file and be able to receive data from a posted form and know how to save that to the database (note in this case if it was ALL entity-attribute-value that would probably be easier to manage than a combination of standard relational and EAV).
You'll probably want to look at .NET Data Contracts as serializable entities to get an understanding of how you might design your XML files to be extensible to allow for things like "select menu has the following 3 options" or text input must match this regex.
Really keep an eye towards extensibility, because you can't build it all at once.

Accessing Remote Data via a VPS in iOS

I am looking to store information on my VPS that will be used by my application to present data to a user. I've looked around thoroughly and still can't manage to find a solid tutorial on how to do this in a real-world application.
I'm new to C# and programming in general, so naturally I looked around a lot before posting. I found that the DataContext and LINQ classes are very helpful for obtaining data. I also researched and found out that I could use attribute-based programming and create properties that are mapped to certain tables or columns in the database.
This would also be very helpful when trying to populate my UITableView with things because I would already have a class full of properties and data that is already hooked up to my database.
However, I just don't know how to apply this. All the remote data tutorials I see for MonoTouch and iOS in general are heavily reliant on JSON, REST, and SOAP, which I am not that familiar with.
In conclusion, all I want to do is connect to my VPS, query some data, and populate a UITableView. I know how to do the last one, but the first two are still really vague to me. Any assistance would be of great help!
.NET offers a lot of ways to communicate data and MonoTouch supports most of them. It's worth noting that WCF (Windows Communication Framework) is not fully supported (only the Silverlight subset is available in MonoTouch).
It's hard to recommend a specific technology without more details. If you're new to C# (and .NET) then you should look for something that offers you (lot of) samples - both for learning and that look similar to the application(s) you want to develop. You should also look (e.g. here on stackoverflow) if people are using it and supporting it (i.e. answering questions about it).
I've been reading (not using yet) about ServiceStack which supports a lot of options, has great performance, many samples and supports MonoTouch. Another popular one is Protobuf.net.
You might also want to ask for other people experiences on the MonoTouch mailing-list (stackoverflow is not the best place to ask for different opinions - at least without a very specific question).

Create a document library with external persistence

I would like to create a custom document library where I use the standard UI but implement a different persistence layer. Basically fetch and display documents from a different source system. This way I can use my existing object model but leverage the great office integration within SharePoint.
I found a decent article here but they are cheating, they have coded a completely new UI for the external persistence.
I have looked at the SPList and SPDocumentLibrary objects but I can't override the necessary methods.
I have looked at the event framework and it is closer but it lacks important events such as 'GetFile' or 'PopulateList'.
Any thoughts?
This isn't a perfect (or probably even a "good") fit for what you're trying to do, but I mention it primarily for awareness and to possibly give you some additional ideas (and warnings).
SharePoint's storage architecture leverages two different back-end stores: one for metadata (always SharePoint's SQL databases), and another for BLOB storage (also SQL by default). In its current form, though, SharePoint allows you to "wire-in" your own BLOB storage provider via a type that implements the ISPExternalBinaryProvider interface. Wiring in a type that implements this interface allows you to continue storing metadata in SQL while storing documents and other BLOB item types in a different store of your choice.
This probably sounds somewhat promising, but there are a couple of serious considerations:
Wiring-in your own ISPExternalBinaryProvider has a farm-wide impact. It's all or nothing, so once the provider is wired in, all sites and libaries will use the new provider.
You'll need to dive into unmanaged code, as the ISPExternalBinaryProvider is doing to require you to work with some IDL.
You can read more here: http://msdn.microsoft.com/en-us/library/bb802976.aspx
My take is that the external BLOB storage (EBS) system is something of a "prototype" at this point -- not ready for prime-time. If nothing else, though, it gives you something to think about. SharePoint Server 2010 will hopefully do more with it and make it more attractive and easy to implement.
For what it's worth!
I have implemented SQL persistence in a Form Library by using a persistence Workflow that runs on creation and update of the library's documents.
I created an Office SharePoint 2007 Workflow project in Visual Studio 2008, retrieved my SPItem document content and extracted the relevant data from the XML generated by the InfoPath WebForm and persisted it to a database.
If you really wanna roll your own external persistance, try taking a look at this brand new, extensive article from june on TechNet:
http://technet.microsoft.com/en-us/magazine/2009.06.insidesharepoint.aspx
Now, hand me the bounty. ;)
Sorry to say, but ISPExternalBinaryProvider is the only way to do this i'm afraid if you want to use standard UI.
P.S. Another major setback is that is a backup / versioning nightmare. Not even sure if versioning is supported.
Perhaps SharePoint 2010 will have a better way to do this...

Is there an ORM (Object Relational Mapper) framework that supports C++ and C#

I'm looking for an ORM that will allow me to write a C# user interface and a C++ service. Both need to access data from the same database. Ideally I want C# and C++ classes to be generated from the database schema that I can then program against.
The database will probably be SQLServer, but that hasn't been decided yet.
Note: I'm doing this in a windows environment, but for reasons I don't want to go into, I can't actually use COM, so a COM solution isn't an option.
This is similar to this question:
ORM (object relational manager) solution with multiple programming language support
However, that wasn't answered well enough, and I can't raise a bounty on it.
Unfortunately this may not be of any help to you, but if you give up on trying to find a pre-build solution, it's not that terribly difficult to develop an in-house version that only supports what you need.
We have an in-house data definition language that we use to generate the SQL schema for our data, and ORM classes for native C++ and .NET. The only real trick is comparing the generated schema with what's already in the database to make migrations to the next version easier.

NHibernate Code Generation

I am working with NHibernate, and a few code generation tools. MyGeneration is one and SmartCode is the other.
This question has been asked before, but I have looked at some other responses and found that the code generation tools in the nHibernate space to be pretty poor.
I might be able to get away with MyGeneration and SmartCode, but are there any other possibilities out there that you have specifically used, and would recommend?
I guess my criteria is that they must work with MSSQL 2008, and tools that are currently being developed would be good too as it seems that some of the tools are not being actively developed any more.
Also the tools would ideally generate the domain objects, and also the nhibernate mapping files - Fluent nhibernate would be good but not essential. It would be good if the templates and method of code generation could be tweaked.
I am a developer so am happy to get my hands dirty on the right tool to make changes.
Thanks.
I strongly recommend you take a look at Visual NHibernate
from Slyce. I have used all tools out there both free and commercial and found it to be the only one that does exactly what it says on the can and more.
It allows you to design your entities either from the ground up or from an existing database.
(source: slyce.com)
It is compatible with most existing dbs
with future suport for Postgresql.
It allows you to customise your entities to your specs
(source: slyce.com)
Other than its ability to go back and forth smoothly between entities and db during design, my most favorate feature is the Diff View
(source: slyce.com)
which shows changes it will make to code before it generates the code. So not only can you see the effect of your changes but you can also cancel the codegeneration in time or simply output to a different folder.
This tool has many many fine features and is now mature. Lastly, there is a 30% discount going on so ;-)
I was using Adapdev's Cudus in the past and now I'm using NConstruct (http://www.nconstruct.com) because I need also application generation, not just NHibernate mapping files.
It doesn't support SQL 2008 and I've contacted them about this issue because I also plan to migrate from SQL 2005 to SQL 2008 in the near future. According to their response newer versions will support it but I don't know when. Maybe more of us need to push them to get SQL 2008 sooner. Otherwise I like this tool very much.
I suggest taking a look at the Summer of Nhibernate series by Steve Bohlen, specifically Session 8 which talks about using NHibernate with a a pre-existing/legacy datastore situation. He uses MyGeneration and provides the template file he uses for doing so.
I've used CodeSmith and been very happy with it. I haven't used their NHibernate template but I know it is just one of the many frameworks they support. Have a look here.
You may want to keep an eye on ABSE (http://www.abse.info). ABSE is a code-generation and model-driven software development methodology that is completely agnostic in terms of platform and language, so you wouldn't have any trouble creating your own generators for NHibernate, MSSQL 2008 and anything else you wish. The big plus is that you can generate code exactly the way you want. The downside is that you may have more work to do at first to build your templates.
Unfortunately, ABSE is still work in progress and an Integrated Development Environment (named AtomWeaver) is still in the making. Anyway a CTP release of the generator is scheduled for January 2010, so we're already close to it.
The NHContrib project includes a tool called hbm2net to generate code. I've never used it, so I've no idea what sort of code it produces, but I know it uses NVelocity. Link to a tutorial.

Categories

Resources