A sioc post containing an image?

26 views
Skip to first unread message

Melvin Carvalho

unread,
Aug 7, 2015, 6:06:22 PM8/7/15
to sioc...@googlegroups.com
I'm looking at implementing the following user story using SIOC Post

https://www.w3.org/wiki/Socialwg/Social_API/User_stories#Reading_a_user.27s_recent_posts

One part requires embedding an image in a post.

What is the correct way to put an image in a SIOC Post?

1. Could the post also be an image class?

2. Could I just embed a .jpg in the SIOC : content?

3. Could I mark the Post as an image?

4. Could I use a predicate OTHER than content for the image?

My first attempt was to use (2). Anyone tried this before?

Breslin, John

unread,
Aug 10, 2015, 11:59:51 AM8/10/15
to sioc...@googlegroups.com
Hi Melvin

I think there's a few ways to do this… But here's some I am thinking of:

  • You could use RSS content:encoded to put it in a Post.
  • How about using dc:hasPart to link to the text and image parts in a Post (this has triggered an album reference in my head https://en.wikipedia.org/wiki/Parts_in_the_Post)?
    • Where does the image appear (at end, or anywhere)? Could potentially use rdf:Seq to put the parts in order…
  • Can also use sioc:attachment to link to the foaf:Image in a Post
John.

--
You received this message because you are subscribed to the Google Groups "SIOC-Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sioc-dev+u...@googlegroups.com.
To post to this group, send email to sioc...@googlegroups.com.
Visit this group at http://groups.google.com/group/sioc-dev.
For more options, visit https://groups.google.com/d/optout.

Melvin Carvalho

unread,
Aug 22, 2015, 8:48:47 PM8/22/15
to sioc...@googlegroups.com
On 10 August 2015 at 17:59, Breslin, John <john.b...@nuigalway.ie> wrote:
Hi Melvin

I think there's a few ways to do this… But here's some I am thinking of:

  • You could use RSS content:encoded to put it in a Post.
  • How about using dc:hasPart to link to the text and image parts in a Post (this has triggered an album reference in my head https://en.wikipedia.org/wiki/Parts_in_the_Post)?
    • Where does the image appear (at end, or anywhere)? Could potentially use rdf:Seq to put the parts in order…
  • Can also use sioc:attachment to link to the foaf:Image in a Post
Thanks John!

Property: sioc:attachment

attachment - The URI of a file attached to an Item. 

OWL T.e:ObjectProperty
Domain:sioc:Item

The text says file, but does that actually mean any URI, including image uri, video URI, sound URI etc.

Stéphane Corlosquet

unread,
Aug 23, 2015, 10:33:07 AM8/23/15
to sioc...@googlegroups.com
Hi Melvin,

Do you want the image to be "extractable" in the sense that your RDF output should include a triple about that image, e.g. <post> schema:image <http://example.com/image.jpg> or you just want to write HTML and embed an image using the img element. Both are possible IMO.

1. Explicit RDF statement about the image

You could use http://schema.org/image in your sioc:Post. The schema.org SIOC mappings state that schema:Article rdfs:subClassOf sioc:Item so that should be legit, since sioc:Post is a sub-class of sioc:Item. We're using schema:image in Drupal 8 for annotating an article featured image.

Note that in RDFa 1.1, the parser will go and parse the content of your HTML even though it is already wrapped in a property-attribute element (which wasn't the case in RDFa 1.0). What this means is that you could have RDFa inside your content:encoded HTML, so something like this:
<div property="content:encoded">
  <p>lorem ipsum <img property="schema:image" src="http://www.w3.org/html/logo/img/html5-display.png" /></p>
</div>

2. Embed img element in the HTML

For random images in a post, we used content:encoded in Drupal 7 (the sioc:content property is only for plain text). Then you can make use of the rdf:HTML datatype to preserve the HTML in your RDF output.

<div property="content:encoded" datatype="rdf:HTML">
  <p>lorem ipsum <img src="http://www.w3.org/html/logo/img/html5-display.png" /></p>
</div>


Steph.

--
You received this message because you are subscribed to the Google Groups "SIOC-Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sioc-dev+u...@googlegroups.com.
To post to this group, send email to sioc...@googlegroups.com.
Visit this group at http://groups.google.com/group/sioc-dev.
For more options, visit https://groups.google.com/d/optout.



--
Steph.
Reply all
Reply to author
Forward
0 new messages