Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7969463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:14:27+00:00 2026-06-04T07:14:27+00:00

Okay I’ve got a problem I’d appreciate someone spreading some light on. Basically I

  • 0

Okay I’ve got a problem I’d appreciate someone spreading some light on. Basically I have the following example below

<rdf:Description rdf:about="http://test.com">
<hasX></hasX>
<hasY></hasY>
<hasA></hasA>
<hasA></hasA>
<hasA></hasA>
</rdf:Description>

I’m trying to produce the following:

<rdf:Description rdf:about="http://test.com">
<hasX></hasX>
<hasY></hasY>
<hasZ>
<hasA></hasA>
<hasA></hasA>
<hasA></hasA>
</hasZ>
</rdf:Description>

I’ve tried adding Property to a Property then a Resource, declaring new Resource, adding Literals, every possible combination of these, however the close I’ve gotten is it to generate a new rdf:description block containing the data I want, outside of the original rdf:description making it worthless.

I really don’t want another <rdf:Description rdf:about=""> to describe the A tags.

Here’s a small test example

String NS = "http://example.com/test";      
Model m = ModelFactory.createDefaultModel();
Resource r = m.createResource("http://meetup/nyc");

Property p = m.createProperty(XmlParser.NS + "hasData");
Property p2 = m.createProperty(XmlParser.NS + "hasData");
Property p3 = m.createProperty(XmlParser.NS + "hasData");

r.addProperty(p, "somedata");
r.addProperty(p2, "somedata2");
r.addProperty(p3, "somedata3");

m.write(System.out);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:14:27+00:00Added an answer on June 4, 2026 at 7:14 am

    Creating a Resource from a model doesn’t automatically add it to that model. I generally add triples to a model via one of the add methods of the Model class:

        String NS = "http://example.com/test#";
        Model m = ModelFactory.createDefaultModel();
        Resource r = m.createResource("http://meetup/nyc");
    
        Property p = m.createProperty(NS + "hasData");
    
        m.add(r, p, "somedata");
        m.add(r, p, "more data");
    
        m.write(System.out);
    

    This will create:

    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
               xmlns:j.0="http://example.com/test#" > 
         <rdf:Description rdf:about="http://meetup/nyc">
             <j.0:hasData>more data</j.0:hasData>
             <j.0:hasData>somedata</j.0:hasData>
          </rdf:Description>
       </rdf:RDF>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay so i have a semi weridish problem with re.sub. Take the following code:
Okay So this doesnt make sense to me.... maybe someone can shed some light.
Okay, I have setup up a handler for a div click but for some
Okay,I've been following this tutorial http://coenraets.org/blog/android-samples/androidtutorial/ Basically it gives me exactly what i need
Okay I got some good advice for Mobile Detection but still having an issue
Okay i have this problem with every page i make. im not sure what
Okay getting some weirdness. I have a simple URLLoader in AS3 that loads an
Okay. Just looking for some advice on how to debug a problem with connecting
Okay I basically want to get the ball rolling and write some CPPUnit tests
Okay, so basically I have a Joomla site and a horizontal jQuery nav. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.