How can I create an instance of a class?

krao - June 9, 2009 - 21:12
Project:Neologism
Version:6.x-1.x-dev
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hello friends, my question is,

Pub is a Class and haveBeer is a property of Pub.

And

Beer is a class with other properties

Then:

Pub -> haveBeer -> XXX

Where XXX is a instance of Beer

Then, How can I create an instance (XXX) of a class Beer

Thanks.

#1

scor - June 10, 2009 - 10:03

Neologism cannot be used to create instances. you can use RDF CCK in conjunction with Drupal nodes, nodes will be instances of a content type beer, which you can map to the Beer class you created in Neologism. Create also a content type for Pub, and link the 2 with a node reference field (which you can map to haveBeer with RDF CCK).

#2

krao - June 22, 2009 - 16:16

Thank scor,

Well then echo it, how to export the data to RDF/XML. Any idea.

Example,

MyInstancePubRock is a instance of Pub, and MyInstaceColdBeer is a instance of Beer

<Pub rdf:ID="MyInstancePubRock">
    <haveBeer>
      <Beer rdf:ID="MyInstaceColdBeer">
        <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">MyInstaceColdBeer</rdfs:label>
      </Beer>
    </haveBeer >
    <rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">MyInstancePubRock</rdfs:label>
  </Pub>

#3

scor - June 22, 2009 - 16:58

the RDF/XML you pasted above looks good as an instance. What is your question? Have you tried RDF CCK?

#4

krao - June 22, 2009 - 17:16

Yes. I am using rdfcck. My question is, how can I export my instances (MyInstancePubRockand MyInstaceColdBeer) to RDF/XML, as in the example above.

MyInstancePubRock is an instance (node) type Pub; and Pub es un node type create whith rdfcck.
Pub has a property called haveBeer (is a node reference whith Beer), create whith rdfcck
MyInstaceColdBeer is an instance (node) type Pub; and Pub es un node type create whith rdfcck

#5

scor - June 22, 2009 - 17:40

add /rdf to the path of the node, for example /node/3/rdf. This will output the RDF data about the node. by default the RDF module will output JSON, so go to admin/settings/rdf to change the serialization format to RDF/XML.

 
 

Drupal is a registered trademark of Dries Buytaert.