> On Friday, 14 February 2014 12:28 AM, Jayesh Sharma
> <[email protected]> wrote:
>
> Hi,
Hello Jayesh,
> I understood the part upto HTML code inside an iframe but I don't get the
> part where you said "based on the above preferences, you will construct a
> sparql query that will fill the desired fields" .So to have a better
> understanding of the idea I have made a PhP page with minimalistic
> functionality, can you please have a look at the page and put me on the track
> .
first, there are multiple possibilities to create and embed such a widget,
iframe is one technology, alternatives can be Javascript [1] or Flash. The main
difference is how the widget will be embedded in third party websites (and
where the rendering will happen, and not to forget possibly SEO impacts).
> Doubts-
> 1. Do I have to put code for widget in iframe or some SPARQL query .
> i) If I have to put SPARQL query in it what query do I have to put ?
> ii) If I have to put HTML code for a simple widget , then what will the
> input fields of generated widget will do ?
>
Your tool needs to create an embed-code, depending on the technology you want
to use.
And of course it also needs to respond the requests that will be generated from
the embed-code, that might be dynamically generated HTML-pages (iframe), json
(Javascript) or whatever (Flash).
Examples of embed-codes:
* Youtube (from [3]):
<iframe width="420" height="315" src="//www.youtube.com/embed/Y-LRjdXM0M0"
frameborder="0" allowfullscreen></iframe>
- here the src-URL delivers the video in scalable form and the iframe
defines the size
- that could be realized similar for DBpedia, the src-URL should contain
the actual resource, e.g. as a HTTP-GET-parameter, scaling of the content could
be realized with responsive CSS
* Twitter (from [4]):
<blockquote class="twitter-tweet" lang="de"><p>2nd <a
href="https://twitter.com/search?q=%23DBpedia&src=hash">#DBpedia</a>
community meeting <a href="http://t.co/pof3el2sBj">http://t.co/pof3el2sBj</a>
co-located with <a
href="https://twitter.com/search?q=%23semantics2014&src=hash">#semantics2014</a>
<a href="http://t.co/dCIsMLbKqh">http://t.co/dCIsMLbKqh</a> <a
href="https://twitter.com/search?q=%23DBpediaLeipzig2014&src=hash">#DBpediaLeipzig2014</a>
<a
href="https://twitter.com/search?q=%23linkeddata&src=hash">#linkeddata</a></p>—
Semantic Web Company (@semwebcompany) <a
href="https://twitter.com/semwebcompany/statuses/434009021138227200">13.
Februar 2014</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
- staticly generated widget, only the tweet-statistics are dynamic
- not really usable for us, since it mainly contains static content, which
would not work for updates in DBpedia Live
* Pinterest (from [2]):
<a data-pin-do="embedPin"
href="http://www.pinterest.com/pin/99360735500167749/">Kent Brewster's pin on
Pinterest.</a>
<!-- Please call pinit.js only once per page -->
<script type="text/javascript" async
src="//assets.pinterest.com/js/pinit.js"></script>
- creates the content of the widget in Javascript, most probably pulls data
(as json) from server
* more examples here:
http://blog.hubspot.com/marketing/how-to-add-html-embed-codes-ht
There are various ways how to achieve a customized styling (height, width,
bg-color): you can put the styling in the embed-code, e.g. in form of embedded
CSS, or by passing styling parameters to the widget. I don't consider
customized styling a very important requirement, maybe two or three sizes might
be sufficient, anything else could also be styled within the clients CSS (if
needed).
@Dimitris: It might even be better to achieve some kind of recognition value.
If you do not create a completely static embed-code, you somehow have to pass
parameters to your widget: there is at least the URI of the resource you want
to display. You don't necessarily have to put the whole SPARQL query in there.
With the URI you can generate a SPARQL query. Simplest SPARQL query would be
SELECT ?p ?o WHERE {<dbpedia-resource> ?p ?o .}
Then you have to filter what to display from the result set.
So, maybe it'd be good to have a SPARQL query for each type, e.g. for dbo:Person
SELECT ?name ?birthdate ?birthplace ?picture WHERE {<dbpedia-resource>
foaf:name ?name . OPTIONAL {<dbpedia-resource> dbo:birthdate ?birthdate .}
OPTIONAL {<dbpedia-resource> dbo:birthplace ?birthplace .} ... }
That means you'll have to determine the type in advance! And for some entities
there is no valuable type information, so maybe that should be checked when
generating the embed-code.
Btw, the DBpedia Sparql endpoint also supports json as a results format:
http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=SELECT+%3Fp+%3Fo+WHERE+%7B%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FDBpedia%3E+%3Fp+%3Fo+.%7D&format=application%2Fsparql-results%2Bjson&timeout=30000&debug=on
> 2. I din't get the part about desired fields to be filled up by SPARQL query
> .(here which fields you are talking about ?)
I suppose that templates will evolve over time, i.e. the displayed information
might change (e.g. when we find out, it is important to show the last movies
for actors ;), so it is good to keep it generic.
The fields depend on what you want to display and on the SPARQL query.
I hope I could help a little bit.
Best
Magnus
[1]
http://www.codeproject.com/Articles/81355/Chapter-5-Creating-Web-Widget-with-HTML-CSS-and-Ja
[2] http://business.pinterest.com/widget-builder/#do_embed_pin
[3] http://www.youtube.com/watch?v=Y-LRjdXM0M0
[4] https://twitter.com/semwebcompany
[5] http://blog.hubspot.com/marketing/how-to-add-html-embed-codes-ht
Am 14.02.2014 um 05:00 schrieb Jayesh Sharma:
>
>
>
> P.S- Attached code is just for sake of understanding the problem please don't
> judge the quality .
>
> Regards
>
>
> On Thursday, 13 February 2014 1:30 PM, Dimitris Kontokostas
> <[email protected]> wrote:
> Hello Jayesh & welcome to the DBpedia community!
>
> This a pretty cool warm up task ;)
>
> The idea is simple. We want to create simple widgets that people can embed in
> their websites. We want to support 4 types of widgets (people, places,
> organizations, work) but you can start with one for now (e.g. People).
> Your task is to create a widget generator. There people will specify width &
> height, background color, a uri (maybe autocomplete from lookup.dbpedia.org)
> and checkboxes for a few predefined fields they want to show (e.g. image,
> name, birth/death date, nationality, ...)
>
> After the selection is complete you will generate some HTML code (inside an
> iframe) where, based on the above preferences, you will construct a sparql
> query that will fill the desired fields.
> For now keep it as simple as possible.
> look for ideas here : https://www.google.gr/search?q=widget+generator
>
> Magnus (in cc) can also help you with this
>
> For language you can suggest ideas but php looks good for this one
>
> Best,
> Dimitris
>
>
>
> On Wed, Feb 12, 2014 at 6:22 PM, Jayesh Sharma <[email protected]>
> wrote:
> Hello all,
> While going through the warm up tasks for project I liked "DBpedia Widgets
> " to work on. But even after going through the idea , the problem statement
> is not clear to me.
>
> What I understood is that I have to create a sample template in HTML which
> can be included as iFrame in the web page by any user .But I din't get the
> part where its said that - "The idea is to create 3-4 templates (people,
> places, organizations, work) that people can generate through a simple user
> interface and copy-paste the html code in their site. In the background it
> will be a simple sparql query that fills the desired fields." If possible can
> anyone please explain me in bit more detail about the problem statement .
>
>
> Regards
> Jayesh Hathila
>
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience. Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> Dbpedia-gsoc mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dbpedia-gsoc
>
>
>
>
> --
> Kontokostas Dimitris
>
>
>
>
> <first.php>------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience. Start now.
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk_______________________________________________
> Dbpedia-gsoc mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dbpedia-gsoc
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Dbpedia-gsoc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-gsoc