Set up own DBpedia server to create new mappings - frameworks

I want to extend the mappings database of DBpedia. Therefore I want to run my own extraction framework instance on my computer. Although the latter is simply done I cannot figure how to feed the framework with newly created mappings.
What I found out so far:
In "config.properties" I can define my own dump-folder.
Some output directory can be defined as well. But what exactly is stored there?
In "Configuration.scala" the url of a mappings page is defined. Does that mean that the framework expects a web page as input which will then be searched for mappings?
My goal is to define some mappings in a plain text file and then tell the extraction framework somehow to use this file as the source of all mappings.
If everything works smoothly I am going to contribute my results to the dbpedia team.
Thanks for your help!

Some output directory can be defined as well. But what exactly is stored there?
The extraction framework outputs N-Triples and N-Quads of all the extracted data, mapping-based and others (see also the files at http://dbpedia.org/Downloads).
In "Configuration.scala" the url of a mappings page is defined. Does that mean that the framework expects a web page as input which will then be searched for mappings?
The Mappings are loaded from http://mappings.dbpedia.org/ which is a wiki for creating and editing mappings. You can get an account and editor rights there and write your own mappings. They will then be loaded when you run the extraction framework (and the data using the mappings will be available in the next release).
My goal is to define some mappings in a plain text file and then tell the extraction framework somehow to use this file as the source of all mappings. If everything works smoothly I am going to contribute my results to the dbpedia team.
You could go ahead and make the framework read the wiki code of mappings from local text files, but I think it would be better to edit them directly on the wiki. Your contribution will be instantly available.

Related

How to upload files and attachments to the sobject record using REST API?

Salesforce has two different UIs and in accordance with it, it has the possibility to store attached files differently.
Two files were uploaded via the classic UI and they are marked as 'attachments'. Other files were uploaded through the new UI and they are marked as 'files'.
I want to upload all of these files using REST API. I cannot find the proper documentation. Can somebody help me with this?
That's not 100% true. In SF Classic UI you were able to upload Files too. It's "just" about knowing the right API name of the table and you'll find lots of examples online.
Attachment and Document objects have exactly same API names, you can view their definitions in SOAP API definition or in REST API explorer (there was something which you can still see in screenshot in here, seems to be down now, maybe they're moving it to another area in documentation...)
The Files (incl. "Chatter Files") are stored in ContentDocument and ContentVersion object. The name is unexpected because long time ago SF purchased another company's product and it was called "Salesforce Content". In beginning it was bit of mess, now it's better integrated into whole platform but still some things lurk like File folders can be called Libraries sometimes in documentation but actual API name is ContentWorkspace. The entity relationship diagram can help a bit: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_content.htm
ContentDocument is a header to which many places in SF link (imagine file wasting space on disk only once but being cross-linked from multiple records). It can have at least 1 version and if you need to update the document - you'd upload new version but all links in org wouldn't change, they'd still link to header.
So, how to use it?
REST API guide: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm
or maybe Chatter API guide (you tagged it with chatter so chances are you already use it): https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_files.htm
some of my answers here might help (shameless plug). They're about upload and reading data too and one is even about data loader... but you might experiment with exporting files first, get familiar with structure before you load?
https://stackoverflow.com/a/48668673/313628
https://stackoverflow.com/a/56268939/313628
https://stackoverflow.com/a/60284736/313628

What's the best way to use CSV source data in a list component?

Disclaimer: I am not an AEM developer, I'm filling in on a project, so forgive me if I am missing the obvious.
I have a page template that will contain a component that will show a list of locations, this template will be used for many city pages.
I'm trying to figure out the best way to get the content into the JCR or read it using a script from a CSV file.
Are there any out-of-the box or open source components out there that can accomplish this?
There are several ways to accomplish your task. The easy part should be rendering the information. You would usually implement a Sling model or a class extending WCMUse, access the repository via the Sling API and render the resources via Adobe HTL. The resources being rendered have to be selected of course: write a Servlet which provides an interface to the resources and use an adequate form element in the component's dialog.
The hard part consists of two parts:
Perhaps just upload the file, process the data and by using the Sling API for resource creation, you can write the data into the repo. You could also utilise the DAM for such tasks and implement a workflow.
Depending on the amount of data, you might want to save the data as JSON string as property of a node.
I hoped that helped a bit.
"Are there any out-of-the box or open source components out there that can accomplish this?"
Simple answer: NO
While there are several libraries that can help you parse CSV files, storing it in JCR depends completely on your project. The structure can be arbitrary or (in a brute force way) you can just store the CSV file as data in your node but that may not be useful.
Depending on how you plan to use the data, it may be useful and optimal to save it in a relevant hierarchy for your project.

browse file path spring webflow

I am currently working on a spring webflow application. In this project there are certain entities that point to a document that contains more information about that entity. However sometimes this document is not provided. In that case the user must be able to research the file for himself.
I need a simple way to let the user search a file and then save the filepath of the selected file into the database.
For most of our components we use richfaces but I don't really like the richfaces <fileUpload> because it's too big and too complex. I have seen that icefaces and tomahawk provide nice solutions but our application is limited to richfaces.
I thought of just using the normal:
<form:form> <input type="file> </form:form>"
but I don't know how I can get the information from that submitted form into my bean. I hoped that I could trigger an event once the file had been selected and then use a listener in my bean that would read the filename from the event. However I cannot find the syntax to do this (I don't even know if this is possible).
Can anyone help me? I know I can just do it with richfaces but I don't think that the client would like that enormous form to just select a filepath
why don't you use a simple jsp file upload?
http://www.tutorialspoint.com/jsp/jsp_file_uploading.htm

Is there an API to read an EDMX file

If I have an .edmx file, is there a way to programmatically access it? I could use XDocument but maybe there is already an api for this?
EDMX file is only for designer. It is even not distributed with your application as is. EDMX contains four components - SSDL, MSL, CSDL and designer information. First three components are extracted during building application and are stored either as resource XML files in the assembly or shipped as external XML files. These files can be read as any other XML files. The only API (present in .NET) which can load them is EntityConnection / MetadataWorkspace in EF.
Library for Object access to edmx
This worked for me fairly well to loop through the entities and generate code tiers from their definitions.. It's really a gold mine for code generation though I wish the built in EF stuff was open source. I can't quite figure out how to create C# objects based on stored procedure results the way EF does.

How to track/handle changes made by other users to source contorl shared emf resource

Our project saves the model in xml resource file. The xml resource tags get listed as nodes in project explorer. This project is part of source control and been worked upon by multiple users. I am able to handle all enotifications and take appropriate actions when user performs the changes in his workspace. Though when other users change the model file, and the new synced file is obtained in other workspace, I get only notification that xml file was modified. What exact model changes were done is not received.
Things work fine if user closes and open the project.Though this is not the right solution. I tried doing resource.unload followed by resource.load.This didn't make any difference. How can I achieve the desired result programmaticaly?
EMF Compare should be able to help you in comparing two files, but I'm not sure if it integrates well with SCMs.