Hello Paula,

and welcome to the group. Any modeling questions such as yours may have multiple answers and be eventually a matter of taste and of the use cases. Some questions you should ask are

- how will typical queries look like, e.g. will the queries start with the id to get the first and last name?

- are the ids stable and unique, so that they could be used as identifiers?

I believe if the person ids are indeed unique and stable, then you could use them as local names for your resources. You could then at any time "find" a person simply by constructing a URI, e.g.

BIND (IRI(CONCAT("http://example.org/my/_";, xsd:string(?id))) AS ?person)

would create a ?person reference using the ?id as input.

In the other direction, you could extract the id/local name of a person URI using

    BIND (afn:localname(?person) AS ?localName) .

and if the first character is an underscore, then you could extract that using

    BIND (fn:substring(?localName, 2) AS ?id) .

In any case, even if you choose to encode the Id as part of the URL, I would also create a triple for it, using a property such as Testing:PersonId below. A real triple is better for matching/joining purposes, because it would only return person instances that really exist (while you can make up any URI).

BTW usually property names and prefixes start with lower case letters, i.e. it should be testing:personId to follow best RDF practices.

Finally, if you need broader advise on non-TopBraid-specific modeling questions, you may want to ask

    http://answers.semanticweb.com/

HTH,
Holger


On 12/8/2012 21:59, Paula Markes wrote:
Hello,
This is my first post to the group, and so I hope this is a question I can ask. While it isn't specific to Composer, I am using TopBraid Composer as my development tool.

I'm looking for input on the following approaches to writing instances of people data - specifically writing a person's first name, last name and person ID. I was asked if I could make the person's ID be the local name of the instance, and *not* add a specific triple for person ID. So, I am investigating that possibility. You'll see below what is my current preferred approach. But, I would like to hear other thoughts. We will need to be able to find people based on their person IDs; and I'm not really sure how to query the local name of an instance… but I'm sure there must be a way. So, if someone knows how to do that also, I'd appreciate your ideas on that too.

Can someone provide thoughts on the 4 options for writing this information, and also on how to query on the local name of an instance?
-Paula



Example 1: Making the Local name of the instance the personID, and using the personID as the label. But, also adding a specific triple that indicates that the it is the personID that is actually 5432. Note that here the local name cannot start with a number, so the _ was used instead.

Testing:_5432
      a       Testing:Person ;
      rdfs:label " 5432"^^xsd:string ;
      Testing:PersonFirstName
              "James"^^xsd:string ;
      Testing:PersonID "5432"^^xsd:string ;
      Testing:PersonLastName
              "Doe"^^xsd:string .


Example 2: Making the Local name of the instance the personID, and using the personID as the label. But, not adding a specific triple that indicates that the personID is actually 1234. So anyone querying this would need to know that the local name and label were the personID. Note that here, too, the local name cannot start with a number, so the _ was used instead.

Testing:_1234
      a       Testing:Person ;
      rdfs:label " 1234"^^xsd:string ;
      Testing:PersonFirstName
              "Jane"^^xsd:string ;
      Testing:PersonLastName
              "Doe"^^xsd:string .


Example 3: Making the Local name of the instance the personID, but making the last name and first name the label. But, not adding a specific triple that indicates that the personID is actually 9876. So anyone querying this would need to know that the local name was the personID. Note that here, too, the local name cannot start with a number, so the _ was used instead.

Testing:_9876
      a       Testing:Person ;
      rdfs:label "Doe, Janet"^^xsd:string ;
      Testing:PersonFirstName
              "Janet"^^xsd:string ;
      Testing:PersonLastName
              "Doe"^^xsd:string .


Example 4: Using an separate numbering scheme for the local name of the instance, here the local name is PR2 (It could be anything really). Making the label the person's last name and first name, and also adding s specific triple that indicates what's the Person ID.
This is my current preferred approach.

Testing:PR2
      a       Testing:Person ;
      rdfs:label "Doe, John"^^xsd:string ;
      Testing:PersonFirstName
              "John"^^xsd:string ;
      Testing:PersonID "5678"^^xsd:string ;
      Testing:PersonLastName
              "Doe"^^xsd:string .

--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en



--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary 
Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en


Reply via email to